-
Posts
292 -
Joined
-
Last visited
-
Days Won
8
Content Type
Events
Profiles
Forums
Blogs
Gallery
Downloads
Posts posted by otuncelli
-
-
You need to derive your plugin class from FileType or PropertyBasedFileType or FileType<TToken, TTWidget> and implement IFileTypeFactory or IFileTypeFactory2 (newer, recommended) interfaces.
Derive from FileType if you don't need to show any settings on Save dialog,
Derive from PropertyBasedFileType if you need to show settings on Save dialog using paint.net's internal controls, aka "IndirectUI",
Derive from FileType<TToken, TTWidget> if you need to show settings on Save dialog using your own controls
You need to implement your own dialog and controls if you need to show settings when opening a file (in OnLoad method). This isn't something supported officially but possible.
A very simple implementation that derives from FileType:
https://github.com/PsdPlugin/PsdPlugin/blob/master/PhotoShopFileType/PhotoshopFileType.cs
The code I've posted should go into the Document OnLoad(System.IO.Stream input) method. You create the document using the input stream, return it and then paint.net opens it.
Also @null54 has lots of open source file type plugins. They helped me a lot when learning stuff.
https://github.com/0xC0000054?tab=repositories&q=paint.net+filetype
-
Sure.
using PaintDotNet; ... ... // surface contains the pixel data Surface surface = new Surface(width, height, SurfaceCreationFlags.DoNotZeroFillHint); // add your surface to a layer BitmapLayer layer = new BitmapLayer(surface, takeOwnership: true) { Name = "Layer Name", Visible = true, BlendMode = LayerBlendMode.Normal, Opacity = 255 }; // then add the layer to a document Document document = new Document(width, height); document.Layers.Add(layer);
- 1
-
37 minutes ago, WallyTheSapien said:
I couldn't find out whether your able to create a new layer via a plugin and I would like to know how to if it is able to be done
Only possible with file type plugins.
-
18 hours ago, janwarming said:
Does this SVG plugin works fully with the windows store version of paint.net?
Yes. It works with the store version. The installer specifically supports it.
18 hours ago, janwarming said:When i open a svg file it display the file as expected, but when i save it, the svg file will be black and white when opened in a browser?
Yes. That's how it works. Colored tracing isn't supported yet. If you need colored tracing i recommend using vtracer or Inkscape.
-
6 hours ago, whysomanyquestions said:
I am getting a No Path image and an error when attempting to export.
Hi, welcome to the forum.
This means the plugin couldn't vectorize your image. It mostly depends on your input image, really. You can't vectorize an empty image e.g. The boundaries/edges need to be clearly visible in your image beforehand for a high quality tracing output. It works best with black/white drawings.
Try changing some settings like Brightness cutoff, Highpass filter radius until it detects the boundaries in your image. You'll be able to export it afterwards.
-
2 minutes ago, null54 said:
Both of those issues should be fixed. Smudge now ignores a null brush when rendering and will create the brushes folder if it does not exist.
Works fine for me now 👍
FYI, @mickiebon
-
58 minutes ago, null54 said:
I am not able to reproduce that crash.
Here is a new build (version 4.1.8656.35967) with a PDB file, which should give me the line numbers for that crash.
Tried to debug it myself. `e.Brush` is null for me in this line. I don't have any brushes. Dropdown is empty. It looks for "Smudge Brushes" folder in "paint.net User Files" which I don't have.
using (Surface brushsource = e.Brush.GetSurface(e.BrushWidth))
Exception details: System.NullReferenceException: Object reference not set to an instance of an object. at pyrochild.effects.smudge.SmudgeRenderer.OnMouseDown(QueuedToolEventArgs le) in D:\src\pdn-smudge\Smudge\SmudgeRenderer.cs:line 158 at pyrochild.effects.common.QueuedToolRenderer.Render() in D:\src\pdn-smudge\Smudge\QueuedToolRenderer\QueuedToolRenderer.cs:line 116 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
-
It's crashing for me as well. It happens as soon as I click.
Exception details: System.NullReferenceException: Object reference not set to an instance of an object. at pyrochild.effects.smudge.SmudgeRenderer.OnMouseDown(QueuedToolEventArgs le) at pyrochild.effects.common.QueuedToolRenderer.Render() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
- 1
-
It sounds like you saved your work in PDN format (or another format) but with PNG extension (or changed it to PNG afterwards.)
Try changing the extension to PDN then open.
Paint.NET chooses the correct decoder based on the file extension. PNG is giving the wrong hint in this case.
-
Updated to v1.0.6.0. This is a big update. Most of the code has been rewritten.
Changelog:
* Added basic image tracing (vectorization) functionality which works best with black & white drawings. You may save the result as SVG or export as Shape.
* Switched to use resvg library for rendering engine. It seems to be rendering SVGs much more accurately.
* Lots of bug fixes and improvements.
* Fixed auto-switching of theme issue.- 1
- 1
-
6 hours ago, Panchdara said:
PDN 5.0.7
C:\Program Files\paint.net\FileTypes\PdfFileTypePlugin\PdfFileType.dll, version 1.0.0.0
Name: PDF/AI File Type Plugin for Paint.NET
Type: PdfFileTypePlugin.PdfFileType
Version: 1.0.0.0
Author: Osman Tunçelli
Copyright: Copyright © 2022 Osman Tunçelli
Website: https://github.com/otuncelli/Portable-Document-Format-Plugin-for-Paint.NET
This plugin is incompatible with this version of paint.net.
A required update is available.You're using an older version of plugin. Latest one is v1.0.0.1
- 1
-
6 hours ago, Colonel_Gerdauf said:
Especially given that Paint.NET has updated to 5.0, I implore an investigation to auto-switching of themes.
Sure. I'll look into it. Thanks for the feedback!
-
7 hours ago, Robot Graffiti said:
I'm using ILRepack to merge some ComputeSharp dlls into my plugin DLL and that's working for me (thanks @BoltBait I saw how to use ILRepack in the CodeLab source on GitHub). But I'm stuck on trimming. The trim option in VS only wants to work for a native exe, not for a portable DLL. Do you guys have a suggestion for a tool or method to trim my plugin DLL's dependencies?
You'll need to use both IL Linker Tool (included in dotnet SDK) and ILRepack for this.
Trimming works for DLLs as well if you call it from the command line (using dotnet exec).
(You'll probably want to fix the path below)
dotnet exec "C:\Program Files\dotnet\sdk\7.0.101\Sdks\Microsoft.NET.ILLink.Tasks\tools\net7.0\illink.dll" -a "$(TargetPath)" all --trim-mode copy --action copy -d $(TargetDir) --skip-unresolved --action link "ComputeSharp.Core" --action link "ComputeShare.D2D1" -out "$(TargetDir)output"
Here is the post-build event you can use for your plugin:
<PropertyGroup> <!-- Set Path Variables --> <PdnRoot>C:\Program Files\paint.net</PdnRoot> <illink>C:\Program Files\dotnet\sdk\7.0.101\Sdks\Microsoft.NET.ILLink.Tasks\tools\net7.0\illink.dll</illink> </PropertyGroup> <!-- Note: Debugging merged/trimmed assemblies can be problematic. So I set a condition that it only works with Release builds. --> <Target Name="TrimAndMerge" AfterTargets="PostBuildEvent" Condition="'$(ConfigurationName)' == 'Release'"> <!-- 1st Step: Trimming with ILLink --> <Exec Command="dotnet exec "$(illink)" -a "$(TargetPath)" all --trim-mode copy --action copy -d $(TargetDir) --skip-unresolved --action link "ComputeSharp.Core" --action link "ComputeShare.D2D1" -out "$(TargetDir)output"" /> <!-- 2nd Step: Merge with ILRepack --> <Exec Command="ilrepack /internalize /union "$(TargetDir)output\$(TargetName).dll" "$(TargetDir)output\ComputeSharp.Core.dll" "$(TargetDir)output\ComputeSharp.D2D1.dll" /lib:"$(PdnRoot)" /out:"$(TargetPath)"" /> <!-- 3rd Step: Remove the output directory and its contents created by illink --> <Delete Files="$(TargetDir)output" ContinueOnError="false" /> <RemoveDir Directories="$(TargetDir)output" ContinueOnError="false" /> </Target>
- 1
- 1
-
Same problem here.
'2' is visible when you first time open the menu. But after you select another size, it disappears.
-
@Pixey No, you don't need to disable Defender completely. You can add an exclusion.
See here:
If you're having trouble to do this (because Windows being so fast to delete the file), just disable "Real-time Protection" temporarily then add the exclusion.
- 1
-
Try this plugin. It is perfect for this job.
-
Yes, this isn't right. There should be a lot of files in this folder.
Try uninstalling Paint.NET. If it fails use this tool to remove any traces of Paint.NET from your computer.
Then you should be able to reinstall.
-
Run the PdnRepair.exe tool which you can find in the installation folder.
- 1
-
There is an option named Shape draw/fill mode.
More info here:
https://www.getpaint.net/doc/latest/ShapeTools.html#12
Example:
-
2 hours ago, null54 said:
Unfortunately, it is not easy to add embedded text to a Windows Forms progress bar.
How about StatusStrip with ProgressBar and Label or just Label?
-
41 minutes ago, BDP said:
Hi, I tried this Shape, put it into the Shapes folder, but don't see it at all
Brian
If you downloaded the zip file you must extract it first. There is a file named nonagon.xaml in it and you must put this file into the Shapes folder, or you can directly extract the zip into the Shapes folder.
( * I had to zip it because forum doesn't allow uploading as .xaml )
1 hour ago, Rle said:A Nonagon Shape is in PDN
It goes up to 8, not 9
-
Contents of .xaml (Paint.NET Shape) file:
<ps:SimpleGeometryShape xmlns="clr-namespace:PaintDotNet.UI.Media;assembly=PaintDotNet.Framework" xmlns:ps="clr-namespace:PaintDotNet.Shapes;assembly=PaintDotNet.Framework" DisplayName="Nonagon" Geometry="M 250,8.7 L 409.9,66.87,495,214.32,465.44,381.89,335.1,491.3,164.9,491.3,34.56,381.89,5,214.32,90.1,66.87,250,8.7 Z "/>
Zipped file:
-
1 hour ago, jsoba77 said:
@otuncelliI tried it but I dont get the same result, same radius aswell
Try lower radius values. My sample was too zoomed in so I had to use bigger radius.
1 hour ago, jsoba77 said:is there anyway to do this and still keep the previous details as before as this seems to ge make the surface too smooth
I don't know. You could try recreating the texture maybe? Because it's easier that way.
I used this texture: https://www.shutterstock.com/image-vector/detailed-woven-fabric-texture-seamless-repeat-1484323856
- 1
-
Try this plugin:
(Radius = 80)
- 1
Sample Effect Plugins for Paint.NET 5.0 (with source code)
in Plugin Developer's Central
Posted
It can be done by adding people under Settings -> Collaborators section. Insights tab is for statistics about your repository which most functions are only available to GitHub Pro users for private repositories.