P13Darksight Posted August 25, 2008 Share Posted August 25, 2008 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. Quote http://p13darksight.deviantart.com Link to comment Share on other sites More sharing options...
Simon Brown Posted August 25, 2008 Share Posted August 25, 2008 Is it listed under "View plugin Load Errors"? Quote Link to comment Share on other sites More sharing options...
P13Darksight Posted August 25, 2008 Author Share Posted August 25, 2008 nope, there is no View Plugin Errors. Quote http://p13darksight.deviantart.com Link to comment Share on other sites More sharing options...
Simon Brown Posted August 25, 2008 Share Posted August 25, 2008 Do you have any other file-types installed that work? Quote Link to comment Share on other sites More sharing options...
P13Darksight Posted August 25, 2008 Author Share Posted August 25, 2008 yes, I hav the DDS file plugin, the IcoCur plugin as well, I do have the HD one as well but i never use that. But those all work like they are supposed to. Quote http://p13darksight.deviantart.com Link to comment Share on other sites More sharing options...
Simon Brown Posted August 25, 2008 Share Posted August 25, 2008 Try comparing it with this: viewtopic.php?f=27&t=22453 Quote Link to comment Share on other sites More sharing options...
P13Darksight Posted August 25, 2008 Author Share Posted August 25, 2008 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. Quote http://p13darksight.deviantart.com Link to comment Share on other sites More sharing options...
Simon Brown Posted August 25, 2008 Share Posted August 25, 2008 Does the template work without your code? Quote Link to comment Share on other sites More sharing options...
P13Darksight Posted August 25, 2008 Author Share Posted August 25, 2008 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. Quote http://p13darksight.deviantart.com Link to comment Share on other sites More sharing options...
Simon Brown Posted August 25, 2008 Share Posted August 25, 2008 To import a template place it in Documents\Visual Studio 2005\Templates\ProjectTemplates\Visual C#. Quote Link to comment Share on other sites More sharing options...
P13Darksight Posted August 25, 2008 Author Share Posted August 25, 2008 Right which is what I did the first time yet it crashes with that Error anyway I am downloading Visual CS 2008 Express Edtion Sp1 just to see. once again thanks for the help Quote http://p13darksight.deviantart.com Link to comment Share on other sites More sharing options...
Simon Brown Posted August 25, 2008 Share Posted August 25, 2008 Right which is what I did the first time yet it crashes with that Error anyway VSCE crashes? If so, simply unzip and copy. Quote Link to comment Share on other sites More sharing options...
P13Darksight Posted August 25, 2008 Author Share Posted August 25, 2008 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 Quote http://p13darksight.deviantart.com Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.