Jump to content
How to Install Plugins ×

Toli's Effects (v2.0.2, 20 Jan. 2008)


Toli

Recommended Posts

MODERATORS NOTE:  null54 has rebuilt this plugin pack for paint.net v4; use that pack instead.

https://forums.getpaint.net/topic/28801-tolis-effects-for-v40/

 

 

I decided to make a separate post about all my effects and make some changes in order to be able to easily maintain them.

The effects are:
1. Mirror/Rotate
2. Mirror / Rotate Menu
3. Engrave/Emboss
4. Smooth

The links are for you to read the discussion about these effects, if you are interested.
However, you cannot download the effects from there any more. The only place from where you can download the effects is from below:
ToliEffects_v202.zip
The zip file contains:
1. IniFile.dll
This is a common required library, used by all my effects, which must be copied in the Effects folder if you want to use any or all the effects.
This library provides to my effects localization support (the effect in your language) and the ability to "remember" on-screen position and the options you selected.
Effect programmers, feel free to use IniFile.dll (ask me for technical support). Just don't credit yourselves for coding it.

2. MirrorRotate.dll
The Mirror / Rotate Effect

3. MirrorRotateMenu.dll
All 4 mirrors and 3 rotates from the previous plugin, now as MenuItems in a Mirror / Rotate Submenu
You should install either MirrorRotate.dll or MirrorRotateMenu.dll

4. EngraveEmboss.dll
The Engrave / Emboss Effect  MODERATORS NOTE:  This effect is incompatible with Paint.NET 4.0x

5. Smooth.dll
The Smooth Effect

6. MirrorRotate.ini
7. MirrorRotateMenu.ini
8. EngraveEmboss.ini
9. Smooth.ini
Language Ini Files used by my effects for localization.
You should copy them along with the corresponding effects to the Effects folder.
(this folder should usually be: "C:\Program Files\Paint.NET\Effects", without the quotes)

10. License.txt
GNU Public License

If someone would like a Setup (an Installer for the plugins), here it is:
ToliEffectsSetup_v202.zip
And this zip file contains the C# sources. It is for effect programmers only.
ToliEffectsSource_v202.zip
Enjoy!
Toli Cuturicu

 

Edited by toe_head2001
Linked to updated pack
Link to comment
Share on other sites

Note to effect programmers:

To use my IniFile.dll, you should:

1. In your project, add a refference to IniFile.dll

2. Add a using Toli; directive

3. In your class which inherits PaintDotNet.Effects.Effect, instantiate the class IniFile

ex: public static IniFile Ini = new IniFile();

4. In the Effect Constructor, instead of the Effect English name, put: Ini.PluginName

5. In your EffectConfigDialog use the same IniFile created before:

ex: private IniFile Ini = YourEffect.Ini;

6. Use it to retrieve localized Control.Text:

ex: this.Ini.GetResourceString(this.YourControl);

7. Use it to retrieve other strings:

ex: string YourString = this.Ini.GetResourceString(YourStringKey, YourStringDefault);

8. Use it to retrieve integers:

ex: int YourInteger = this.Ini.GetResourceInteger(YourIntegerKey, YourIntegerDefault);

9. Make the Form remember its Location:

9.1. Put in Form_Load: this.Ini.ReadFormLocation(this);

9.2. Put in Form_FormClosing: this.Ini.WriteFormLocation(this);

10. Make the Form remember its Size:

10.1. Put in Form_Load: this.Ini.ReadFormSize(this);

10.2. Put in Form_FormClosing: this.Ini.WriteFormSize(this);

... and so on.

Your initial Ini File should look like this:

YourEffect.ini

[Encoding]

CodePage=Your CodePage

[en]

PluginName=Your Plugin Name

YourControl=Your Control Text

...

[fr]

PluginName=Votre Plugin Nom

YourControl=Votre Control Texte

...

[de]

...

[and so on]

...

Link to comment
Share on other sites

Saving preferences in a sub-directory of Program Files is a very bad thing to do. That won't work in any non-Administrator account, such as Standard User in XP, or in Vista at all.

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

It doesn't matter how the file got there in the first place. The permissions you have when you place the file could be radically different than when you access it. Or it could be a completely different user, etc.

Place it somewhere in AppData, like in Environment.GetFolderPath(ApplicationData). Usually that's C:/Documents and Settings/username/Application Data, or C:/Users/username/AppData/Roaming. Localization should definitely be separate from per-user data. I have no idea why you're implementing INI stuff when the ResourceManager class is just 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

Because I don't know how to use ResourceManager (I can learn, though) and I know how to use Ini Files.

And I cannot write my own strings in Paint.NET *.resources files. So, what else can I do?

Anyway, I read for example OK and Cancel from Resources. But what about my own strings?

Link to comment
Share on other sites

Not knowing something really isn't an excuse, like you said you can learn it just fine. Do not read strings from PdnResources. It is not meant for use by plugins, and will be removed in a future version. And then your plugins will break.

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

Considering there are only 3 plugins in there, and the installer is only 355KB, it's ridiculously slow... Also, if you're gonna go with an installer, you should provide checkboxes so users can choose which plugins they want.

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

To: pyrochild

It certainly is slow. Blame Microsoft and Windows Installer for this!

I can add checkboxes and I probably will.

However, you can download ToliEffects_v200.zip, which has no setup, only the dlls to choose from.

Link to comment
Share on other sites

To: pyrochild

It certainly is slow. Blame Microsoft and Windows Installer for this!

I can add checkboxes and I probably will.

However, you can download ToliEffects_v200.zip, which has no setup, only the dlls to choose from.

Keep both, if users wanna download DLL, they can. If they want EXE, they also can. :)

The_next_thousand_words_by_0_ASH_0.png

All creations Ash + Paint.NET [ Googlepage | deviantArt | Club PDN | PDN Fan ]

Link to comment
Share on other sites

It takes a long time because a System Restore (System Protection in Vista) checkpoint is created every time before an MSI install or uninstall operation starts. This is a good thing. I do NOT recommend disabling System Restore.

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

1. I know that the original Emboss Effect has the Angle parameter, but I really don't know why anyone should use other values than 45 and 135 degrees, which are in my implementation.

2. For larger Width values, the calculation involving trigonometry become awfully slow and almost unusable. I suppose that was the reason for which the original plugin was limited to Width = 1.

Link to comment
Share on other sites

Let's take them one by one:

1. Smooth doesn't have an UI at all (see SeamlessHelper as another example)

2. EngraveEmboss UI is similar to almost all the other plugins. It has two RadioButtons though, because the user needs to select one of two choices. And, of course, it remembers its on-screen position, user settings and uses localization (French and German available so far) if Paint.NET is started in one of these languages. These enhancements are there out of respect to the user.

3. MirrorRotate has the same enhancements and also a different UI. That's because the user has actually to choose between 7 (related) effects, so Trackbars, UpDowns or AngleSelectors won't work. Only Buttons would do the job. And, if I have Buttons, why not Images on them, showing the user what behaviour to expect from let's say "1st Diagonal Mirror".

The Cancel Button is the Top-Left-Most one and the OK Button is actually the other 7 Buttons, one for each effect.

However, you also have an on-screen preview of the effect when you hover the button.

Is this information satisfactory?

Link to comment
Share on other sites

Let's take them one by one:

1. Smooth doesn't have an UI at all (see SeamlessHelper as another example)

2. EngraveEmboss UI is similar to almost all the other plugins. It has two RadioButtons though, because the user needs to select one of two choices. And, of course, it remembers its on-screen position, user settings and uses localization (French and German available so far) if Paint.NET is started in one of these languages. These enhancements are there out of respect to the user.

3. MirrorRotate has the same enhancements and also a different UI. That's because the user has actually to choose between 7 (related) effects, so Trackbars, UpDowns or AngleSelectors won't work. Only Buttons would do the job. And, if I have Buttons, why not Images on them, showing the user what behaviour to expect from let's say "1st Diagonal Mirror".

The Cancel Button is the Top-Left-Most one and the OK Button is actually the other 7 Buttons, one for each effect.

However, you also have an on-screen preview of the effect when you hover the button.

Is this information satisfactory?

I think you misunderstood me. I'll explain it with pictures this time. Lets take the UI of your Emboss/Engrave plug-in, and then pyrochild's Outline Object UI.

file.php?id=423outlinegui.png

Now, ignore the theme change. How come your UI's are similar, to say the Colour/Layers...etc. windows, while the majority of the others have a normal windows box around them, like in pyrochild's plug-in?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...