Jump to content

Using PaintDotNet.Resources In Your Plug-in's?


Andrew D

Recommended Posts

Well, to be honest, I'm just wondering how you can use tools in the PaintDotNet.Resources file in VS C# Express 2008. I can use the normal design tools pretty well, but when I'd want to add something which aren't in the usual toolbox, how can you use them, such as the angle slider, and also the other tools which you can use?

Or, of course, I'm talking a load of nonsense :)

Link to comment
Share on other sites

(with my words, forgive my english)

You use the code to describe the controls you need. You don't use the usual form...

there is +/- advantage...

+

faster to code

easier to code

really easy to modify

-

controls are limited in choice (no radio button for instance)

controls are listed from up to bottom, you can't place them left or right...

highly depending on the program (paint.net) so an update (sooner or later) could disable the plugin...

no preview in the form editor...

BTW, as now I've done/changed some of my plugin, I think I will use this way for most of them...

It's really make me focus on the code of the effect instead of boringly create the UI and every controls rules...

Link to comment
Share on other sites

(with my words, forgive my english)

You use the code to describe the controls you need. You don't use the usual form...

there is +/- advantage...

+

faster to code

easier to code

really easy to modify

-

controls are limited in choice (no radio button for instance)

controls are listed from up to bottom, you can't place them left or right...

highly depending on the program (paint.net) so an update (sooner or later) could disable the plugin...

no preview in the form editor...

BTW, as now I've done/changed some of my plugin, I think I will use this way for most of them...

It's really make me focus on the code of the effect instead of boringly create the UI and every controls rules...

So, which .dll extention would I need to browse through the Object Manager to see the controls you'd want to use?

Link to comment
Share on other sites

I really recommend just using the IndirectUI stuff in 3.20. Otherwise you'll be spending years inside Visual Studio trying to write your plugin's UI. Use IndirectUI and tell me what features you'd like in the next release.

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 really recommend just using the IndirectUI stuff in 3.20. Otherwise you'll be spending years inside Visual Studio trying to write your plugin's UI. Use IndirectUI and tell me what features you'd like in the next release.

I'll browse the IndirectUI in the Object Browser now.....

EDIT: I still don't really get it. How exactly do you use the controls? I see the same commands repeated over and over and over again. I'll just check the blog for when you showed it when making the "Mandelbrot Fractal" plug-in....

protected override PropertyCollection CreatePropertyCollection()
{
List props = new List();

props.Add(new Int32Property(PropertyNames.Factor, 1, 1, 10));
props.Add(new DoubleProperty(PropertyNames.Zoom, 10, 0, 100));
props.Add(new AngleProperty(PropertyNames.Angle));

props.Add(new DoubleVectorProperty(
PropertyNames.Offset,
Pair.MakePair(0.0, 0.0),
Pair.MakePair(-1.0, -1.0),
Pair.MakePair(1.0, 1.0)));

props.Add(new Int32Property(PropertyNames.Quality, 2, 1, 4));
props.Add(new BooleanProperty(PropertyNames.InvertColors));

return new PropertyCollection(props, new PropertyCollectionRule[0]);

I'm hoping that's an example of using the IndirectUI system, right?

EDIT2: I have a request aswell, allow us to have more than one column for designing UI's using it?

Link to comment
Share on other sites

I have a request aswell, allow us to have more than one column for designing UI's using it?

Yes, that's an example of a request for a future version :) This and more is planned, I just had to keep the scope of the system small enough for the first release in order to release something soon. Small and stable beats large and buggy any day.

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 have a request aswell, allow us to have more than one column for designing UI's using it?

Yes, that's an example of a request for a future version :) This and more is planned, I just had to keep the scope of the system small enough for the first release in order to release something soon. Small and stable beats large and buggy any day.

Ah, I see.

So, in the code sample I put in my post, is that the way you would use the IndirectUI system?

Link to comment
Share on other sites

Mostly. It's changed a little though, mostly in the sense that I've renamed a few things.

Derive from PropertyBasedEffect, then override OnCreatePropertyCollection() and OnRender(). To customize the UI, override OnCreateConfigUI() where I recommend you first call CreateDefaultConfigUI() (that's all that the base implementation of OnCreateConfigUI() does).

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...