Jump to content

Made hiper plugin in CodeLab, don`t know how to create UI


Recommended Posts

Okay I made really great Plugin with great possibilities, very powerfull tool, but there are two problems.:

1)A bit too slow, need help with optimization.

2)Don`t have any tool, and don`t know how to create UI.

So here is the code for CodeLab(Can be downloaded in Plugins section).

Asmageddon_The best effect SourceCode.zip

Logo-1.gif

The Asmageddon is coming.

You better prepare... or you won`t survive

Link to comment
Share on other sites

I've changed some lines for optimisation...

1.Take src[x,y] in TEMP to extract RGBA, 1 pixel read instead 4...

2.If selection visible useless, as x,y are inside the selection...

3.Avoid same calculation in the loop, calculate it 1 time in a variable before the loop(s) : mPI = Math.PI /180.0;

Do you want me to make a UI for that ?

Link to comment
Share on other sites

I definitely recommend writing for the IndirectUI system in 3.20. Targeting v3.10 and writing your own WinForms dialog with all the data binding and other requisite clumsiness is just a waste of time. I even plan on writing documentation for it!

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 definitely recommend writing for the IndirectUI system in 3.20. Targeting v3.10 and writing your own WinForms dialog with all the data binding and other requisite clumsiness is just a waste of time. I even plan on writing documentation for it!

Of course I was thinking in this way...(at least not targeting past(soon) version).

May I ask you?

...some help to implement the list of choice control that (you should know) I'm not able (yet) to make working correctly.

...if you have found/changed something about the set ragne proprieties for the sliders.

(wounder if I could public link to beta center)

And BTW the new IndirectUI will be a great help for this plugin with a hudge of parameters (at least to code), but I'm afraid that the size of the UI in the end will force me/us to write a visualy efficient UI form for the user...

Link to comment
Share on other sites

:cry:

Only 3/5 (about) of the UI is visible on a screen wide 1600x1200...

visible:

      configUI.SetPropertyControlValue(PropertyNames.Mode, ControlInfoPropertyNames.DisplayName, "Choose the color mode");
     configUI.SetPropertyControlValue(PropertyNames.Mode, ControlInfoPropertyNames.Description, "1:RGB grey, 2:RGB normal, 3:Prim.Sec.*RGB Grey, 4:Prim.Sec.*RGB normal, 5:Blur the image");
     configUI.SetPropertyControlValue(PropertyNames.BlendMode, ControlInfoPropertyNames.DisplayName, "Choose the blend mode");
     configUI.SetPropertyControlValue(PropertyNames.BlendMode, ControlInfoPropertyNames.Description, "1:Normal, 2:Additive, 3:Substraction, 4:Multiply, 5:Lighten, 6:Darken");
     configUI.SetPropertyControlValue(PropertyNames.PercentRed, ControlInfoPropertyNames.DisplayName, "Color percentage");
     configUI.SetPropertyControlValue(PropertyNames.PercentRed, ControlInfoPropertyNames.Description, "Red");
     configUI.SetPropertyControlValue(PropertyNames.PercentGreen, ControlInfoPropertyNames.DisplayName, string.Empty);
     configUI.SetPropertyControlValue(PropertyNames.PercentGreen, ControlInfoPropertyNames.Description, "Green");
     configUI.SetPropertyControlValue(PropertyNames.PercentBlue, ControlInfoPropertyNames.DisplayName, string.Empty);
     configUI.SetPropertyControlValue(PropertyNames.PercentBlue, ControlInfoPropertyNames.Description, "Blue");
     configUI.SetPropertyControlValue(PropertyNames.IRed, ControlInfoPropertyNames.DisplayName, "Color include/exclude");
     configUI.SetPropertyControlValue(PropertyNames.IRed, ControlInfoPropertyNames.Description, "Red");
     configUI.SetPropertyControlValue(PropertyNames.IGreen, ControlInfoPropertyNames.DisplayName, string.Empty);
     configUI.SetPropertyControlValue(PropertyNames.IGreen, ControlInfoPropertyNames.Description, "Green");
     configUI.SetPropertyControlValue(PropertyNames.IBlue, ControlInfoPropertyNames.DisplayName, string.Empty);
     configUI.SetPropertyControlValue(PropertyNames.IBlue, ControlInfoPropertyNames.Description, "Blue");
     configUI.SetPropertyControlValue(PropertyNames.OpacityR, ControlInfoPropertyNames.DisplayName, "Color Opacity");
     configUI.SetPropertyControlValue(PropertyNames.OpacityR, ControlInfoPropertyNames.Description, "Red");
     configUI.SetPropertyControlValue(PropertyNames.OpacityG, ControlInfoPropertyNames.DisplayName, string.Empty);
     configUI.SetPropertyControlValue(PropertyNames.OpacityG, ControlInfoPropertyNames.Description, "Green");
     configUI.SetPropertyControlValue(PropertyNames.OpacityB, ControlInfoPropertyNames.DisplayName, string.Empty);
     configUI.SetPropertyControlValue(PropertyNames.OpacityB, ControlInfoPropertyNames.Description, "Blue");
     configUI.SetPropertyControlValue(PropertyNames.Lenght, ControlInfoPropertyNames.DisplayName, "Lenght");
     configUI.SetPropertyControlValue(PropertyNames.Angle, ControlInfoPropertyNames.DisplayName, "Angle");
     configUI.SetPropertyControlType(PropertyNames.Angle, PropertyControlType.AngleChooser);
     configUI.SetPropertyControlValue(PropertyNames.Intensity, ControlInfoPropertyNames.DisplayName, "Intensity");
     configUI.SetPropertyControlValue(PropertyNames.SizeX, ControlInfoPropertyNames.DisplayName, "Height of matrix");
     configUI.SetPropertyControlValue(PropertyNames.SizeY, ControlInfoPropertyNames.DisplayName, "Width of matrix");

invisible:

      configUI.SetPropertyControlValue(PropertyNames.SwapColors, ControlInfoPropertyNames.DisplayName, string.Empty);
     configUI.SetPropertyControlValue(PropertyNames.SwapColors, ControlInfoPropertyNames.Description, "Swap P/S Colors");
     configUI.SetPropertyControlValue(PropertyNames.InvertColors, ControlInfoPropertyNames.DisplayName, string.Empty);
     configUI.SetPropertyControlValue(PropertyNames.InvertColors, ControlInfoPropertyNames.Description, "Invert Colors");
     configUI.SetPropertyControlValue(PropertyNames.Vector, ControlInfoPropertyNames.DisplayName, string.Empty);
     configUI.SetPropertyControlValue(PropertyNames.Vector, ControlInfoPropertyNames.Description, "Vector (use Angle Y/N)");
     configUI.SetPropertyControlValue(PropertyNames.VectorOffset, ControlInfoPropertyNames.DisplayName, "VectorOffset");
     configUI.SetPropertyControlType(PropertyNames.VectorOffset, PropertyControlType.AngleChooser);
     configUI.SetPropertyControlValue(PropertyNames.VectorAngle, ControlInfoPropertyNames.DisplayName, "Vector Angle");
     configUI.SetPropertyControlValue(PropertyNames.Vector, ControlInfoPropertyNames.Description, "off:By angle offset, on:By angle+90 offset");
     configUI.SetPropertyControlValue(PropertyNames.OffsetMode, ControlInfoPropertyNames.DisplayName, "Offset Mode");
     configUI.SetPropertyControlValue(PropertyNames.OffsetMode, ControlInfoPropertyNames.Description, "off:Normal offset, on:Vector offset");
     configUI.SetPropertyControlValue(PropertyNames.RandXoffset, ControlInfoPropertyNames.DisplayName, "Random offset");
     configUI.SetPropertyControlValue(PropertyNames.RandXoffset, ControlInfoPropertyNames.Description, "X");
     configUI.SetPropertyControlValue(PropertyNames.RandYoffset, ControlInfoPropertyNames.DisplayName, string.Empty);
     configUI.SetPropertyControlValue(PropertyNames.RandYoffset, ControlInfoPropertyNames.Description, "Y");
     configUI.SetPropertyControlValue(PropertyNames.AngleVariation, ControlInfoPropertyNames.DisplayName, "Angle Variation");
     configUI.SetPropertyControlValue(PropertyNames.AngleMod1, ControlInfoPropertyNames.DisplayName, "Angle mod1");
     configUI.SetPropertyControlValue(PropertyNames.AngleMod2, ControlInfoPropertyNames.DisplayName, "Angle mod2");

Link to comment
Share on other sites

:cry:

Only 3/5 (about) of the UI is visible on a screen wide 1600x1200...[attachment=0]asfx.png[/attachment]

Mabye in VS C# 2008 Express (yes, it's out and the old template still works apart from the PdnLib refrence) change the design to something more rectangular?

Mabye a bit like the GenTree plug-in?

Link to comment
Share on other sites

:cry:

Only 3/5 (about) of the UI is visible on a screen wide 1600x1200...[attachment=0]asfx.png[/attachment]

Mabye in VS C# 2008 Express (yes, it's out and the old template still works apart from the PdnLib refrence) change the design to something more rectangular?

Mabye a bit like the GenTree plug-in?

It's like that because I'm using the IndirectUI possibilities...I'll have to create my own form then...

Link to comment
Share on other sites

What does this effect allow for?

lol, I don't know (yet), it's some kind of conditional color tint with random/noisy things...

I've tested it with CodeLab, but then I have to change manually the parameters...

I even don't know how to call it...

@Asmageddon Prince: could you give some more details...

Link to comment
Share on other sites

What does this effect allow for?

lol, I don't know (yet), it's some kind of conditional color tint with random/noisy things...

I've tested it with CodeLab, but then I have to change manually the parameters...

I even don't know how to call it...

@Asmageddon Prince: could you give some more details...

Well, the UI is ginarmous to say the least, and you can't really create a form easily from it.

BTW, as far as I can see, VS C# Express 2005 and 2008 are EXACTLY the same.

Link to comment
Share on other sites

BTW, as far as I can see, VS C# Express 2005 and 2008 are EXACTLY the same.

At first glance, 2008 is just slightly prettier. Dig a little deeper, and you'll find gobs of new features and enhancements to old ones. Of course, I still recommend fullscale Visual Studio over the express editions any day, unless you're writing an XNA game.

xZYt6wl.png

ambigram signature by Kemaru

[i write plugins and stuff]

If you like a post, upvote it!

Link to comment
Share on other sites

BTW, as far as I can see, VS C# Express 2005 and 2008 are EXACTLY the same.

At first glance, 2008 is just slightly prettier. Dig a little deeper, and you'll find gobs of new features and enhancements to old ones. Of course, I still recommend fullscale Visual Studio over the express editions any day, unless you're writing an XNA game.

I'll check the change log......they better have made good use of those 3 years......

They don't have a change log >_>

Link to comment
Share on other sites

@MattBlackLamb: Property system doesn't have an implementation for radio buttons, I think. It does, however, have dropdowns. But MadJik hasn't figured out how to make those work yet, and I haven't even bothered to try, as none of my new plugins need one yet.

@Andrew D: The changes aren't just in Visual Studio; you'll need to poke around in .NET's change log to see all of what's new.

xZYt6wl.png

ambigram signature by Kemaru

[i write plugins and stuff]

If you like a post, upvote it!

Link to comment
Share on other sites

Pyro, I'll openly admit to not being a coder (I know some very basic HTML & that's it), so I didn't know what is / was possible, I just thought radio buttons would make more sense than a slider.

dA

Son, someday you will make a girl happy for a short period of time. Then she'll leave you & be with men that are ten times

better than you can imagine. These men are called musicians. :D

Link to comment
Share on other sites

BTW, as far as I can see, VS C# Express 2005 and 2008 are EXACTLY the same.
Then you aren't looking hard enough :D
......they better have made good use of those 3 years......

Off Topic, but to be fair, it's only just over 2 years (2005-10-27 -> 2007-11-19)

And you can't really make statements of entitlement like that, it's not like you paid for it :lol:

ed-sig2.png.3c040e8f8a7b22d05fbfbad8e5ea6994.png

Link to comment
Share on other sites

BTW, as far as I can see, VS C# Express 2005 and 2008 are EXACTLY the same.
Then you aren't looking hard enough :D
......they better have made good use of those 3 years......

Off Topic, but to be fair, it's only just over 2 years (2005-10-27 -> 2007-11-19)

And you can't really make statements of entitlement like that, it's not like you paid for it :lol:

Good point...... :)

Anyways, I've had a little go at trying to get it done....got pretty much nowhere......mainly because I have no idea how to create the forms used in it.....even though I have PaintDotNet.System and all the other .dll's as refrences.

Link to comment
Share on other sites

:cry:

Only 3/5 (about) of the UI is visible on a screen wide 1600x1200...[attachment=0]asfx.png[/attachment]

Can you send me the source code for what you're working on here? It's *supposed* to add a scroll bar if it gets too big.

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

Ok, I've corrected some layout issues that should make it work fine using IndirectUI. If the controls overflow the working area of the screen, then it will introduce a scrollbar automatically.

I still cannot reproduce the Ctrl+F issue you claim to have. I changed your "mode" property to use a StaticListChoiceProperty, and everything worked perfectly fine.

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.

 Share

×
×
  • Create New...