Jump to content

image button for effect / plugin

Recommended Posts

I can't get a png to load on a button. This normally works in c# but in pdn, the dll doesn't load the image. Any ideas? pdn does not crash so the image is referenced correctly, when it is not, it crashes when the effect is run.

this.leftButton.Image = getIcon("AlignPlugin.Icons.left.png");

        protected virtual Image getIcon( String filename )
           Assembly assembly = Assembly.GetExecutingAssembly();;
           Stream imageStream =  assembly.GetManifestResourceStream( filename );
           return new Bitmap(imageStream);

Link to comment
Share on other sites

From what I remember, when visual styles are enabled (as they are in Paint.NET), you have to set the FlatStyle on the button to one of the values other than System.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html


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.

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