Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/07/2021 in all areas

  1. shape file: Penrose-Triangle.zip Note: it's in .zip only because the forum didn't allow me to upload .xaml file - but it contains a single xaml file Feel free to use it as you want and even add it to some shape pack. Would love attribution, but you don't have to Example in paint.net: Note: while it's not a plugin but rather a shape, a xaml file, it still seems like the most appropriate sub-forum. Let me know if you want me to move this post, or delete+create if needed.
    4 points
  2. Heads up for anyone who uses CodeLab: We are working on getting CodeLab updated for .NET 5. Please be patient.
    2 points
  3. Plugins don't need to worry about this -- the IClipboardService manages this for them by creating a new STA thread and routing requests through it. (see internal classes: ClipboardServiceForEffects, MarshaledClipboardTransaction) Do not use the WinForms Clipboard class directly. The reason this is failing is because you're asking WinForms' Clipboard class if there's text, and it does require the STA dance, so it says no. Only request clipboard data through the IClipboardService, IClipboardTransaction, and their extension methods. You can use IClipboardTransaction::IsNativeDataPresent(ClipboardNativeFormats.Text) to test for text. There should probably be another extension method to make that simpler, but there currently isn't. You first need to open a transaction with the IClipboardService. Something like this, IClipboardService clipboard = this.Services.GetService<IClipboardService>(); using (IClipboardTransaction clipTx = clipboard.Open()) { if (clipTx.IsNativeDataPresent(ClipboardNativeDataFormats.Text)) { // you have text, so get it with clipTx.TryGetText(), which should not return null at this point } }
    2 points
  4. The Clipboard stuff in WinForms needs to be run in a STA thread; which paint.net Effects do not run in. This returned true when run in CodeLab: Thread t = new Thread(() => { bool foo = System.Windows.Forms.Clipboard.ContainsText(); Debug.WriteLine(foo); }); t.SetApartmentState(ApartmentState.STA); t.Start(); t.Join(); You could also try the Clipboard methods that are part of WPF. I don't know if they have the same thread requirements. (PresentationCore.dll is not referenced in CodeLab, so I could not quickly try it myself) https://docs.microsoft.com/en-us/dotnet/api/system.windows.clipboard.containstext?view=netframework-4.7
    1 point
  5. Copy the image. Ctrl Shift C Paste into a new image. Ctrl Alt V Save the new image in whatever format you want.
    1 point
  6. @Pluto is a Planet Smudge plugin may also be helpful.
    1 point
×
×
  • Create New...