Jump to content


Photo

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


  • Please log in to reply
66 replies to this topic

#1 Toli

Toli
  • Members
  • 136 posts
  • LocationRomania
  • Reputation:0

Posted 13 November 2007 - 09:54 PM

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:
Attached File  ToliEffects_v202.zip   76.08K   19543 downloads
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

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:
Attached File  ToliEffectsSetup_v202.zip   218.89K   4203 downloads
And this zip file contains the C# sources. It is for effect programmers only.
Attached File  ToliEffectsSource_v202.zip   114.46K   1235 downloads
Enjoy!
Toli Cuturicu

Edited by Ego Eram Reputo, 09 December 2010 - 08:35 AM.
updated plugin links


#2 Bob

Bob
  • Members
  • 3,033 posts
  • LocationLyon, France
  • Reputation:3

Posted 13 November 2007 - 10:04 PM

The only place from where you can download the effects is the link below:

*tearful absence of any download link*

#3 pyrochild

pyrochild

    Plugin Author of the Year 2012

  • Administrators
  • 11,273 posts
  • LocationColorado
  • Reputation:137

Posted 13 November 2007 - 10:10 PM

There's no link there... Also, you should probably keep your source code and compiled DLLs in separate ZIPs to avoid confusion.
sig8.png
[I write plugins and stuff]

If you like a post, upvote it!

#4 Toli

Toli
  • Members
  • 136 posts
  • LocationRomania
  • Reputation:0

Posted 13 November 2007 - 10:14 PM

Done.

#5 Toli

Toli
  • Members
  • 136 posts
  • LocationRomania
  • Reputation:0

Posted 13 November 2007 - 10:46 PM

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

#6 Rick Brewster

Rick Brewster

    Paint.NET Author and Developer

  • Administrators
  • 12,609 posts
  • LocationKirkland, WA
  • Reputation:125

Posted 13 November 2007 - 11:03 PM

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: http://blog.getpaint.net/
Donations are always appreciated! http://www.getpaint.net/donate.html

Posted Image

#7 Toli

Toli
  • Members
  • 136 posts
  • LocationRomania
  • Reputation:0

Posted 13 November 2007 - 11:06 PM

1. That's right, but if the user doesn't have permission to write there, how on Earth did he put the *.dll there in the first place?
2. Ok, then. Where should I put the Ini Files?

#8 Rick Brewster

Rick Brewster

    Paint.NET Author and Developer

  • Administrators
  • 12,609 posts
  • LocationKirkland, WA
  • Reputation:125

Posted 13 November 2007 - 11:24 PM

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: http://blog.getpaint.net/
Donations are always appreciated! http://www.getpaint.net/donate.html

Posted Image

#9 Toli

Toli
  • Members
  • 136 posts
  • LocationRomania
  • Reputation:0

Posted 13 November 2007 - 11:52 PM

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?

#10 Toli

Toli
  • Members
  • 136 posts
  • LocationRomania
  • Reputation:0

Posted 14 November 2007 - 12:18 AM

I added a Setup for the plugins in the first post.
I don't want regular computer users to complain like "But how do I install the plugins?! :-("

#11 Rick Brewster

Rick Brewster

    Paint.NET Author and Developer

  • Administrators
  • 12,609 posts
  • LocationKirkland, WA
  • Reputation:125

Posted 14 November 2007 - 12:23 AM

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: http://blog.getpaint.net/
Donations are always appreciated! http://www.getpaint.net/donate.html

Posted Image

#12 pyrochild

pyrochild

    Plugin Author of the Year 2012

  • Administrators
  • 11,273 posts
  • LocationColorado
  • Reputation:137

Posted 14 November 2007 - 12:36 AM

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.
sig8.png
[I write plugins and stuff]

If you like a post, upvote it!

#13 Toli

Toli
  • Members
  • 136 posts
  • LocationRomania
  • Reputation:0

Posted 14 November 2007 - 12:38 AM

Ok.
But... how can I know which of your public classes can I count on and which should I just ignore?
Only what is in PaintDotNet.Effects and PaintDotNet.Core?

#14 Toli

Toli
  • Members
  • 136 posts
  • LocationRomania
  • Reputation:0

Posted 14 November 2007 - 12:41 AM

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.

#15 pyrochild

pyrochild

    Plugin Author of the Year 2012

  • Administrators
  • 11,273 posts
  • LocationColorado
  • Reputation:137

Posted 14 November 2007 - 12:43 AM

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

That defeats the purpose of having an installer in the first place, doesn't it? ;)
sig8.png
[I write plugins and stuff]

If you like a post, upvote it!

#16 Toli

Toli
  • Members
  • 136 posts
  • LocationRomania
  • Reputation:0

Posted 14 November 2007 - 12:47 AM

Ok, don't get upset on me.
You are right. I am tired and a bit pissed off for some other reason.
I will add the checkboxes when I have enough time.
I have to go now. It's 03.00 in my country.

#17 pyrochild

pyrochild

    Plugin Author of the Year 2012

  • Administrators
  • 11,273 posts
  • LocationColorado
  • Reputation:137

Posted 14 November 2007 - 12:49 AM

Not upset with you. Just offering constructive criticism to a fellow plugin author.
sig8.png
[I write plugins and stuff]

If you like a post, upvote it!

#18 Ash

Ash

    Former Moderator

  • Members
  • 6,381 posts
  • Locationhttp://tinyurl.com/6kqz9v
  • Reputation:5

Posted 14 November 2007 - 01:11 AM

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

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


#19 Rick Brewster

Rick Brewster

    Paint.NET Author and Developer

  • Administrators
  • 12,609 posts
  • LocationKirkland, WA
  • Reputation:125

Posted 14 November 2007 - 09:52 PM

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: http://blog.getpaint.net/
Donations are always appreciated! http://www.getpaint.net/donate.html

Posted Image

#20 Ash

Ash

    Former Moderator

  • Members
  • 6,381 posts
  • Locationhttp://tinyurl.com/6kqz9v
  • Reputation:5

Posted 15 November 2007 - 02:01 AM

For your Engrave / Emboss plugin, Is it possible you can add "angle" option would be even better.
Thanks :)

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