Jump to content

My plugin is not showing up, whats up wit that?


P13Darksight

Recommended Posts

Recently I have started to make Plugins for Paint.Net, I've had no trouble with my previous plugin which was an effect.But now my new plugin is going to be a File Type Plugin.Now problem the problem is that when I copy the DLL into the FileTypes folder of Paint.Net it won't show my file type, when I am prompted to choose the image I mean.

I am preety sure I am doing everything right, but I have been wrong before.

Here is my constructor code:

                       public WES2D():base("WES2D",FileTypeFlags.SupportsLoading | FileTypeFlags.SupportsSaving,new string[]{".wes2D"})
                        {
                        }

Then I do all the proper overrides, I havnt added in any actual code to do the loading besides creating a blank image.

Just so you know I am using Visual C# 2005 Express Edition, I am using Paint.Net v3.35.

Link to comment
Share on other sites

okay I checked it out and I just copied and pasted the code into mine and made the absolute neccesarily changes

still nothing

Just in case I did infact something wrong here is all I was able to get as far as.

using System;
using System.Collections.Generic;
using System.Text;
using PaintDotNet;
using PaintDotNet.Effects;
using PaintDotNet.Data;
using System.Windows.Forms;
using System.Drawing.Imaging;
using System.Drawing;
namespace WES2DPlugin
{
   public class Wes2D:FileType 
   {
       public Wes2D()
           : base("WES2D", FileTypeFlags.SupportsLoading | FileTypeFlags.SupportsSaving,
            new string[] { ".wes2D" }) { }
       protected override Document OnLoad(System.IO.Stream input)
       {
           try
           {
               Bitmap b = new Bitmap(500, 500);

               return Document.FromImage(;
           }
           catch
           {
               MessageBox.Show("Problem Importing File");

               Bitmap b = new Bitmap(500, 500);
               return Document.FromImage(;
           }
       }
       protected override void OnSave(Document input, System.IO.Stream output, SaveConfigToken token, ProgressEventHandler callback)
       {
           RenderArgs ra = new RenderArgs(new Surface(input.Size));
           input.Render(ra);

           ra.Bitmap.Save(output, ImageFormat.Bmp);
       }

   }
}

by the way thank you for the quick replies I no your trying your best to help so thanks.

Link to comment
Share on other sites

the template won't even open up when I choose to it in File->New Project->Visual C#->My Templates->Paint.Net FileType

it says something about import , so I am thinking it is because I am not using C# 2008

Anyway here is the error i get

The imported project "C:\Microsoft.CSharp.targets" was not found.Confirm that the path in the declaration is correct, and that the file exist on disk.

Link to comment
Share on other sites

okay I found out what was wrong with the template..

The template was made with a 2008 edition of Visual Studio, where I have a 2005 Edition of Visual Studio, so they were incompatible, anyway I took one look at the template code and relized what I was doing wrong, I hadnt implemeted a IFileTypeFactory to my plugin, once I did that everything went smoothly.

Thanks for the help, couldn't of figured it out with out you

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.

×
×
  • Create New...