Jump to content

null54

Moderator
  • Posts

    1,963
  • Joined

  • Last visited

  • Days Won

    89

Everything posted by null54

  1. Version 1.0.8.2 works on Paint.NET 5.0.1, but it does not support the 5.0 specific features. I plan to file an issue in the dotnet runtime repository.
  2. @user.by I took a deeper look into that heap corruption crash. It appears to be a regression in .NET, something is enabling the OS termination on heap corruption feature for the PSFilterShim process. That plugin works fine in version 1.0.8.2 of PSFilterPdn, which is built against .NET Framework version 3.5.
  3. It is not possible for a plugin to do this. Plugins cannot create layers.
  4. Release version 1.0.3. This release is for Paint.NET 5.0+. Changes: Updated to libjxl version 0.8.0.
  5. Release version 1.5.0. This release is for Paint.NET 5.0+. Changes: Converted the plugin to a BitmapEffect Added icons for 125% and 150% dpi
  6. The Paint.NET UI freeze has been fixed in version 2.0.1. That filter still crashes with a heap corruption error, but PSFilterPdn will now show an error message when it does. Release version 2.0.1. This release requires Paint.NET 5.0. Changes: Fixed an issue where a 32-bit filter crashing the PSFilterShim process would make Paint.NET unresponsive. Show an error message if a 32-bit filter crashes the PSFilterShim process. Fixed the Effects folders searching when PSFilterPdn is installed in a sub-folder. Technical details about the freezing issue (if anyone is interested): PSFilterPdn 2.0.0 and earlier would make Paint.NET the parent window of the 32-bit filter dialog, even though it was running in a separate 32-bit process. This appears to have caused the OS to think that Paint.NET is covered by an invisible modal dialog if the PSFilterShim process crashed. Raymond Chen has a blog post on cross-process window ownership: https://devblogs.microsoft.com/oldnewthing/20130412-00/?p=4683. To fix this I changed PSFilterShim to show its own window that the 32-bit filters use as their parent window. See this GitHub commit: https://github.com/0xC0000054/PSFilterPdn/commit/ef6e2c3f464b6bd1e9ad152be27269642253c82b
  7. It looks like that filter is causing the PSFilterShim process to crash with a heap corruption error. I am not sure why this would be freezing PDN.
  8. @Rick Brewster I got your FillRectange code sample working, but Direct2D ignores the second FilllRectangle call that I am trying to use to mask out the selection. IBitmap<ColorAlpha8> sourceMask = this.imagingFactory.CreateBitmap<ColorAlpha8>(this.environment.Document.Size); IDirect2DFactory d2dFactory = this.serviceProvider.GetService<IDirect2DFactory>(); RectInt32 maskBounds = RectInt32.Empty; using (PaintDotNet.Direct2D1.IDeviceContext deviceContext = d2dFactory.CreateBitmapDeviceContext(this.sourceMask)) { using (ISolidColorBrush selectedRegionBrush = deviceContext.CreateSolidColorBrush(Colors.White)) using (ISolidColorBrush unselectedRegionBrush = deviceContext.CreateSolidColorBrush(Colors.TransparentBlack)) using (deviceContext.UseBeginDraw()) { IReadOnlyList<RectInt32> selectionRects = this.environment.Selection.RenderScans; RectInt32 surfaceBounds = this.sourceMask.Bounds(); deviceContext.Clear(Colors.TransparentBlack); foreach (RectInt32 rect in selectionRects) { RectInt32 expandedRect = RectInt32.Inflate(rect, this.sampleSize, this.sampleSize); RectInt32 selectedArea = RectInt32.Intersect(expandedRect, surfaceBounds); deviceContext.FillRectangle(selectedArea, selectedRegionBrush); // Exclude the pixels in the original selection. // Direct2D ignores this command. deviceContext.FillRectangle(rect, unselectedRegionBrush); maskBounds = RectInt32.Union(maskBounds, selectedArea); } } } The alternative approach I have been considering is drawing the mask outline using 4 rectangles, but I would like to avoid that if possible.
  9. Yes, but my mask bitmap is custom MaskSurface type a not a WIC Bitmap. This avoid having to lock and unlock the bitmap when using it. One issue that I see with your proposed code is that the original selection rectangle is not excluded, but that could be solved with a second FillRectangle call. Does FillRectangle already handle clipping the rectangle to the image bounds? I also need the bounds of the expanded region, but I can get that from the scan rectangles.
  10. Yes, the post-build step used the Header Pack Script for CFF Explorer to remove the debug section. The script is also posted at the bottom of the following NTCore blog post, with some more detail about what it does: https://www.ntcore.com/files/richsign.htm Stop using that script. 😀
  11. It was related to a post-build script I was using that removed the debug information section from the DLL headers. No idea why it was causing that behavior, perhaps a checksum or something with the managed code sections was not being correctly updated when it rebuilt the headers after removing that data.
  12. I am trying to convert my Content Aware Fill plugin to a BitmapEffect. The effect creates a new PdnRegion representing the area outside of the selection that the plugin uses for sampling, this region is then converted to a mask bitmap. private PdnRegion CreateSampleRegion() { if (this.sampleSize < 0) { throw new ArgumentOutOfRangeException(nameof(this.sampleSize), "The sample size cannot be negative."); } Rectangle[] expandedScans = this.selection.GetRegionScansInt(); for (int i = 0; i < expandedScans.Length; i++) { // Expand each scan rectangle by the specified number of pixels. expandedScans[i].Inflate(this.sampleSize, this.sampleSize); } PdnRegion sampleRegion; using (PdnGraphicsPath path = new()) { path.FillMode = System.Drawing.Drawing2D.FillMode.Winding; path.AddRectangles(expandedScans); sampleRegion = new PdnRegion(path); } // Clip the expanded region to the surface bounds and exclude the original selection. // Excluding the original selection prevents sampling from the area that is to be replaced. sampleRegion.Intersect(this.sourceBounds); sampleRegion.Exclude(this.selection); return sampleRegion; } What would the equivalent IGeometry code be? ID2D1GeometrySink does not have an AddRectangle method, so I assume that the rectangles would have to be converted to lines.
  13. Release version 1.3.16. This release is for Paint.NET 5.0+. Changes: Fixed the detection of misnamed files.
  14. Release version 1.11.0. This release is for Paint.NET 5.0+. Changes: Updated DirectXTex to the December 15, 2022 release. Detect if the image using the wrong file extension and load it using the appropriate Paint.NET FileType.
  15. Release version 1.3.5. This release is for Paint.NET 5.0+. Changes: Improved metadata handling when loading TIFF images. Report dcraw_emu error messages. Improved performance when loading PPM files.
  16. You need to install BoltBait's plugin pack for PDN 5.0:
  17. That DDS file is a PNG with a .dds file extension.
  18. Release version 3.2.0. This release is for Paint.NET 5.0+ Changes: Updated G'MIC to version 3.2.0. Added a missing Qt style plugin to the zip files.
  19. Release version 1.3.15. This release is for Paint.NET 5.0+. Changes: Updated to libwebp version 1.3.0.
  20. You can look in Effects > Plugin Errors to see which plugins are not being loaded. BoltBait's Outline Object plugin has a new version for PDN 5.0: https://forums.getpaint.net/topic/121343-boltbaits-gpu-accelerated-plugin-pack-for-paintnet-v50-updated-2023-01-12/
  21. The Plugin index date is when the plugin was first published, it uses the date the the forum topic was created.
  22. Possibly, I would have to investigate it more. From a quick look at the Smudge plugin code on GitHub, the brush loading code would need a fairly extensive rewrite to handle formats other than PNG.
  23. The plugin is working for me in 5.0. What error message are you getting?
  24. Release version 1.3.6. This release is for Paint.NET 5.0+ Changes: Fixed a crash when reading long strings. Various performance optimizations.
×
×
  • Create New...