Jump to content

otuncelli

Members
  • Posts

    292
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by otuncelli

  1. I tried to fix this on my fork here: https://github.com/otuncelli/CodeLab Changes: https://github.com/BoltBait/CodeLab/compare/master...otuncelli:master I can create a PR if all seems OK and you're not planning to do something else?
  2. Also in Task Manager, if you've any 32 bit program running on 64 bit Windows (including Paint.NET), it'll show (32 bit) or *32 next to its name.
  3. Okay, I see. Implementations delegate to C++ to do the actual job. Also there is PaintDotNet.Rendering.CompositionOps.{BlendMode}.Static property which seems to be marked as public. Is there a difference between this one and BinaryPixelOp? Which one should be used for plugin development?
  4. I'm not sure about this. There seems to be a deep inheritance going on there and all other overloads of Apply are end up calling this abstract Apply function which can not be resolved until runtime. See: https://sharplab.io/#v2:C4LghgzgtgPgAgBgARwIwDoBKBXAdsASygFN0BhAeygAcCAbYgJwGUmA3AgY2IgG4BYAFBC4AZhQAmFKgDsSAN5CkyyRMWCVmpABEmBNsQAmZOpAhIKAIwBWSALxJcxAO469B46YgQAFAEoBDS1lK2t0AEFqajoATx9UABokCSTRAKUVAF8hbOFBMUk3Rn0jEzMkECQAIUhiMu8FDOUCigNGYsNiJAJ8JEjouJ7gJDAkoaRLPybGoOC4OTAkAGoJwM1c3JFxMEsIYEYwTmG4KRqIOq9zdU0Cnb2Do+7e/tifcdGn4cm1lWmAbQAssRgAALCiGACSNDoPiBoPBUOiAHlqIQKLgIBEAOZYxg8CAlCG4Og9HpYvwAXWmBXGLxiADEKIxuESSU43r0PuNJvYAHwjZarJDTf5wsGQ6Gw4HixF0FFojHoAByFFZpNw5KpsxQ4lpUViKrV7PeY16PLs/MWK0svGFeRu4jgABY+vrBpzTV9PUgAPp+a7BV0DHyjb7TTR0xnM4hG4ghhJh7URt2G4k9OOh9LajZCIRAA=
  5. public abstract ColorBgra Apply(ColorBgra lhs, ColorBgra rhs); BinaryPixelOp.Apply calls a virtual method where JIT Inlining is not possible. I'm not sure about performance. It might be slower unless C++ or intrinsics are involved. But it makes the code much cleaner and safer. I was not able to use it because my input was not a Surface.
  6. Yes, it matches with my CustomBlend function.
  7. Debug.WriteLine(ColorBgra.Blend(a, b, b.A)); This method's parameter name (cbAlpha) was also confused me. You should pass cb's original alpha value here (which is 255) but you're passing the new alpha value (which is 128). void PreRender(Surface dst, Surface src) { ColorBgra a = ColorBgra.White; ColorBgra b = ColorBgra.Black; Debug.WriteLine(ColorBgra.Blend(a, b, 0)); Debug.WriteLine(ColorBgra.Blend(a, b, 255)); Debug.WriteLine(ColorBgra.Blend(a, b.NewAlpha(128), b.A)); }
  8. You don't need to install any .NET Framework/Core runtime anymore. Paint.NET uses SCD (self-contained deployment). https://docs.microsoft.com/en-us/dotnet/core/deploying/#publish-self-contained
  9. @midora I would do this with HTML/CSS/JS so the output can be viewable on any browser or can be served on web. CSS already supports most blend modes in Paint.NET. I kinda hear Rick saying "in your dreams"
  10. This is only possible (not exactly but very close) with a file type plugin. You can develop one for your own needs, Or use this plugin maybe? (each layer is a reference to an image in the zip archive):
  11. @AndrewDavid This issue doesn't seem to be related to CodeLab or maybe I'm missing something? In explorer, right click column header and select "Date modified". This setting is for per folder. If you want it to be default for all folders, click "View menu"->"Options"->"View tab"->"Apply to all Folders" See here for detailed explanation: https://www.guidingtech.com/add-columns-folders-windows-10-file-explorer/
  12. @Guillaume_69 Try setting "Standard digits" (Chiffres standard) manually to 0123456789 (in 2nd screenshot). I don't know why it's empty for you. I can't even select an empty value for this setting. Also Paint.NET doesn't seem to be calling the overload of String.Format method that takes invariant culture parameter. Is this string really need to be localized? @Rick Brewster at PaintDotNet.ScaleFactor.ToString() in D:\src\pdn\src_4_3_x\PaintDotNet\ScaleFactor.cs:line 209
  13. Updated to v0.0.0.3 (alpha) Changelog: Fixed a crash that happens when other than 100% display scaling is used. Thanks to @Martins and @lynxster4 Updated to use Chromium/Pdfium 99.0.4789.0
  14. I'm not able to reproduce. But since you're using 144 dpi, I have some ideas. Currently, there are some issues in .NET 6.0 related to high DPI. Is anyone else getting this error?
  15. For both loops in PreRender method. for (int p = 0 ; p < radius ; radius++){ // <-------- p++ ... }
  16. A workaround here: I managed to fix this error by downloading the Surface Pro 4 drivers from the link below (it contains wintab32.dll for both x64 and x32): https://www.microsoft.com/en-us/download/details.aspx?id=49498 I put wintab32.dll and DHid.dll in the same directory as other plugin's files and it worked.
  17. I'm getting the same error. I don't have this file in Windows/System32 directory. Maybe there is a Windows component I need to install ?
  18. @John Scott These warnings are normal and harmless. You can just ignore and/or suppress them. You also don't need to switch to VS 2022. Just install .NET 6 SDK and manually edit your project file to target .NET 6.0. Though, VS 2019 is not officially supported and you won't be able to create a new .NET 6 targeting project from its interface.
  19. I'm curious. What is the registry values (open & edit) for the MS Store version? It has to be different. I know there is paintdotnet: command that can be used to start both Store and Classic.
  20. CircleText plugin doesn't need OptionBasedLibrary.
  21. For debugging only, to see if it still crashes. It's generally easy to wrap portions of code in a lock block and test. Load and Save are different and your managed code might be completely seems thread-safe/independent but if you've a native library reference, it's a different story. For example, every pinvoke call in one of my plugin (alternative pdf) in a lock block, otherwise it crashes because the native library I use is not thread-safe itself. Anyway, it seems like your issue was different and not related to thread-safety like mine.
  22. OperationCanceledException thrown by Paint.NET on CancelableStream. Plugins have no idea what the stream type is nor whether if the underlying stream can throw that exception. It's not listed in possible exceptions: https://docs.microsoft.com/en-us/dotnet/api/system.io.stream.write?view=net-6.0#Exceptions System.OperationCanceledException: The operation was canceled. at System.Threading.CancellationToken.ThrowOperationCanceledException() at PaintDotNet.IO.CancelableStream.Write(Byte[] buffer, Int32 offset, Int32 count) in D:\src\pdn\src\PaintDotNet\IO\CancelableStream.cs:line 78 This problem generally means the plugin is not thread-safe. You should try using locks in more places and see if that crash repeats. If possible, try wrapping your whole OnSave method in a lock block. Your plugin needs to be thread-safe for preview generation. Also you should catch (in the plugin's code) OperationCanceledException and initiate the cleanup and reset state or you'll have memory leaks and crashes. I'd like to have an official way to disable Preview generation and have completely different API for preview generation (like OnGeneratePreview() method) so I don't have to use hacks like Stopwatch.
  23. This method involves no plugin: 1.- Resize your source image the resolution you want at the end using Nearest Neighbor resampling algorithm. Source image is 64x64 and you want to 5 times to repeat it vertically and horizontally. So resize to: 320x320 2.- Press CTRL+Shift+Z or open Layers->Rotate/Zoom tool. 3.- Check "Tiling" box. And enter Zoom parameter 0.2 (1/5)
  24. The installer reads installation path from registry but it can't find it. You should only specify installation path during PDN installation and not change it afterwards. It'll break all plugin installers that tries to detect version/location and it can also mess up your PDN file associations. You can use portable versions. For extracting Codelab.dll, You can use ILSpy to extract the resource. https://github.com/icsharpcode/ILSpy The resource name you'd want to extract is Install.Attachments.Codelab.dll
×
×
  • Create New...