Zammy Posted September 12, 2008 Posted September 12, 2008 As such I want to create a plugin which will animate a PNG. It will draw in a different part of the PNG for certain time on a separate window. I downloaded the Effects Plug-in Template but I do not want to manipulate the canvas directly. Just take parts of it and draw it in a separate window. Can I create this through this Template? I am new to plug-in programming and programming in general but am pretty comfortable with C# and I think I can manage. Hints and advice well appreciated! Quote
Simon Brown Posted September 12, 2008 Posted September 12, 2008 Here is some sample-code: using System; using System.Collections.Generic; using System.Text; using PaintDotNet; using PaintDotNet.Data; using System.IO; using System.Drawing; using System.Windows.Forms; using System.Drawing.Imaging; namespace Paint.NET_FileType1 { public class MyFileType : FileType { public MyFileType() : base("Text Document", FileTypeFlags.SupportsLoading | FileTypeFlags.SupportsSaving, new String[] { ".txt" }) { } protected override Document OnLoad(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, Stream output, SaveConfigToken token, Surface scratchSurface, ProgressEventHandler callback) { RenderArgs ra = new RenderArgs(new Surface(input.Size)); input.Render(ra); Form f = new Form(); PictureBox p = new PictureBox(); p.Image = ra.Bitmap; f.Controls.Add(p); f.ShowDialog(); } } public class MyFileTypeFactory : IFileTypeFactory { public FileType[] GetFileTypeInstances() { return new FileType[] { new MyFileType() }; } } } Quote
Zammy Posted September 14, 2008 Author Posted September 14, 2008 Thank you for the code but is not clear what I am supposed to do with it. Its not commented either. Anyway I have started working with the Effect Template from Sepcot and I have done the UI Dialog box asking the user about input. Problem is after that when I try to render the animation into a new window things start getting nasty a little bit. I read in http://www.boltbait.com/pdn/codelab/help/overview.html that the Render method is called many times with different rectangle parts of the selected area. What I need is after the user has inputted his preference to just start a new Form with the whole surface inputted as Bitmap class. From there on I think I have written my Form class to dispaly the animation. Where to put my code after I have the input from the user? I have tried using the Render function but its called continuously which is not what I need. Thank you for your help. Quote
Simon Brown Posted September 14, 2008 Posted September 14, 2008 Anyway I have started working with the Effect Template from Sepcot Surely for a PNG animation plugin a filetype would make more sense (and that is the type of plugin I posted). I have created a template for FileTypes, here is the link: viewtopic.php?f=27&t=22453. Quote
Zammy Posted September 14, 2008 Author Posted September 14, 2008 I am going to try with File Type plugin. I will keep the thread up to date. Quote
Zammy Posted September 15, 2008 Author Posted September 15, 2008 You code snippet does not seem to run correct or I am not doing something right. I open a file with this plug-in. (I select from the drop-down menu when I open a file that it is with my file type). Then I try to save it and expect a new form to show up with the context of it inside a picture box right? Well it does not. I tried with save or save as. I am using the express edition so I am not sure how to make my VS debug it. I am not sure if OnSave() is being called. If it is. It should make a new window but it doesn't. Why? No idea If you have any clues that would be great. (Assumptions: OnSave() is called when you save the file.) Quote
Bob Posted September 17, 2008 Posted September 17, 2008 As such I want to create a plugin which will animate a PNG. MNG or APNG? Quote No. Way. I've just seen Bob. And... *poof!*—just like that—he disappears into the mist again. ~Helio
carmen Posted December 21, 2008 Posted December 21, 2008 Hi. I'm planning to do an animation short next year. I'll be doing it mostly in my computer using Creatoon and Pencil. But I don't know what's the screen size and the resolution to be used in order to export the animation to film or dvd. What is the best resolution and the size of the screen - in DPI, to be used to export my animation? Quote Keyword Software
Rick Brewster Posted December 22, 2008 Posted December 22, 2008 carmen, this is not the right thread for this. This is the forum for plugin developers, not content creation. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html
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.