Jump to content

Lens flare WIP


MadJik
 Share

Recommended Posts

Searching help for debug this / or improve the code.

 

help1.png

 

 

This effect is drawing 14 forms (circle/hexagone/rays).
It should look like a lens flare effect.
It needs a layer filled with black color. You could set the origin of the light by plotting a single white pixel on the canvas.
The center of the canvas is the second point used to draw a virtual straight line.
Each centers of the 14 forms are placed over this line.

 

Settings allow to choose each type of form, distance, radius etc.
14 forms x 7 parameters, this is a number of 98 datas to define/handle.
Plus some other (7) common parameters.

 

The problems are:
-(ok)changes on the 98 settings run the rendering.
-(ko)changes on the 7 common parameters have not effect.
-(ko)first cycle of the effect doesn't work (linked?).
-(ko)tried to have sliders for the 7 common parameters (failed so I delete these sliders).

 

Instead of checking each change of parameters, I use a single counter++ to check for any change.

To make it works, I use the button reset of a common parameter or make a change on one of the 98 settings.

 

Other points to solve:
-dark theme for Windows form effects?
-XML save and load works fine. Any idea to set a saved file as default setting to load when the effect is openning?
-Tab (tabulation sequence) is set to go column by column. Any idea to have a checkbox to change it to go row by row?

 

DLL:

http://jcljay.free.fr/pdn/LensFlare.zip

 

Visual Studio Sources

http://jcljay.free.fr/pdn/LensFlareSRC.zip

 

Thanks.

Link to comment
Share on other sites

Most of the rendering issues were solved by utilizing OnSetRenderInfo.

 

3 hours ago, MadJik said:

-dark theme for Windows form effects?

Done.

 

3 hours ago, MadJik said:

-XML save and load works fine. Any idea to set a saved file as default setting to load when the effect is opening?

Take a look in InitialInitToken(). I placed some code there that should work.

 

3 hours ago, MadJik said:

-Tab (tabulation sequence) is set to go column by column. Any idea to have a checkbox to change it to go row by row?

You just need to change the TabIndex on each control. I've done this for you; VS Designer makes it extremely fast and easy to update them all.

 

3 hours ago, MadJik said:

-(ko)tried to have sliders for the 7 common parameters (failed so I delete these sliders).

I didn't add these, but I'm guessing the issue was that they got into a update loop.

i.e. Slider updates NumBox, causing the NumBox to update the Slider, causing the Slider to update the NumBox, ect.

Just create a flag so that doesn't happen. Take a look at my Pie Chart plugin if you're not sure.

 

 

https://kalama.ga/gfx/code/LensFlareSrc20180104.zip

Link to comment
Share on other sites

@toe_head2001 many thanks, it's much better. I have to dig more in the code to understand the changes.

 

For the tabulation sequence, I want to add a checkbox for the user to choose between horizontal or vertical tabulation.

I will Something try with "foreach (Control control in this.Controls)".

 

Link to comment
Share on other sites

Hmm... The issue with Blur when pressing OK... I can't explain it.

It works when the dialog is open, and it works when you press Ctrl+F.

 

I use very similar code in my Blur Fill plugin, and it works fine there.

Maybe there's a bug in paint.net that affects custom UI effects, but not IndirectUI effects... I don't know; more testing would need to be done.

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