Jump to content

The constructor for Classic Effects requires a reference to PaintDotNet.Windows?


Recommended Posts

I'm using the Effect constructor that takes a System.Drawing.Image.

Why do I need a reference to PaintDotNet.Windows, if I'm not using the constructor that takes a IBitmapSource?

 

image.png

 

Do we even need a Classic Effect constructor that takes a IBitmapSource?

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
Share on other sites

The IBitmapSource constructors are just there for consistency with the new BitmapEffect and GpuEffect classes.

 

This is an unfortunate side effect of how .NET and C# do things ... if it says you need a reference, then you need one, even if you know you don't use it. *sigh* You shouldn't need a using PaintDotNet.Imaging; though, so none of the new types will be pulled into scope.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

I'm not planning to deprecate the use of System.Drawing.Image for the sake of the effect constructors (classic or new). While IBitmapSource is superior in many important ways, particularly locking and multithreading, there isn't currently a good way to go directly from embedded resources to an IBitmapSource (and even if I provide one, it's just not important enough to push on it). So System.Drawing.Image is de facto the way to do things here anyway.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

5 hours ago, BoltBait said:

 

I need this if I'm ever to rewrite my Creative Text Pro plugin to the new system.

 

Not necessarily. The new plugin base classes still accept an Image, they don't require an IBitmapSource.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...