tobi235 Posted March 11, 2008 Posted March 11, 2008 Hi, I have no clue how to program a plugin which saves coordinates in a textfile of an object which is detectet by an algorithm. Can you help me, how i realize the part of saving the coordinates? regards tobi Quote
Rick Brewster Posted March 11, 2008 Posted March 11, 2008 There's a whole forum dedicated to this... Moved to Effects Development Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html
Illnab1024 Posted March 11, 2008 Posted March 11, 2008 Moved to Effects Development Don't you man File Format API >.> Quote ~~
david.atwell Posted March 12, 2008 Posted March 12, 2008 Or, sabrown100, you could answer the question. I have no idea (not a programmer), so I can't. :-) But he is correct. You should make your thread title more unique. Look at the rules (specifically number 6) Quote The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.Amy: But how did it end up in there?The Doctor: You know fairy tales. A good wizard tricked it.River Song: I hate good wizards in fairy tales; they always turn out to be him.
MadJik Posted March 12, 2008 Posted March 12, 2008 You should be more patient. Nobody here is 'at your service, Sir!' This is an example of code you could reuse to create a text file within an effect type plugin (not a file type). // Part of code to include in a code for plugin // to "debug.print" some values in a text file. // This code alone isn't working! using System.IO; [ThreadStatic] public static bool init = false; // maybe also declare these varibles as public static!! public static int margT = -1, margB = -1, margR = -1, margL = -1; if (!init) { //========================================== // calculating process should be here ! // Example: margT = -1; margB = -1; margR = -1; margL = -1; // Loop through all the pixels to find Left/Right/Top/Bottom // position of an object (something in a transparent area) for (int y = selection.Top; y < selection.Bottom; y++) { for (int x = selection.Left; x < selection.Right; x++) { CurrentPixel = src[x, y]; if (CurrentPixel.A > 0) { if (margR == -1) { margR = MinX; } else if (x > margR) { margR = x; } if (margL == -1) { margL = MaxX; } else if (x < margL) { margL = x; } if (margB == -1) { margB = MinY; } else if (y > margB) { margB = y; } if (margT == -1) { margT = MaxY; } else if (y < margT) { margT = y; } } } } // end of calculating process //========================================== // This will always rewrite (write over) the file c:\temp\debugtext.txt using (StreamWriter streamWriter = new StreamWriter("c:\\temp\\debugtext.txt")) { streamWriter.WriteLine(String.Concat("//margin Left :", margL)); streamWriter.WriteLine(String.Concat("//margin Right :", margR)); streamWriter.WriteLine(String.Concat("//margin Top :", margT)); streamWriter.WriteLine(String.Concat("//margin Bottom:", margB)); streamWriter.Close(); } init = true; } You could provide your code if you want more help! Quote My DeviantArt | My Pictorium | My Plugins | Donate via Paypal
tobi235 Posted March 13, 2008 Author Posted March 13, 2008 no, not u or pnd sucks. my idea sucks. i realized now a c# project. i think its better for my requirements and easier to program... so long stay tuned Quote
tobi235 Posted March 13, 2008 Author Posted March 13, 2008 to ur info, :wink: i wanted a plugin, that get svg coordinates from a normal bmp. my problem was the override render method. This Method overwrites the svg file every time with the new catched coordinates. And the algorithm to recognize the edges was just to long for a plugin i think. regards Quote
MadJik Posted March 13, 2008 Posted March 13, 2008 Ok, You should already have a lot of information about svg. This is a link I've found to help me to understand what you are talking about... http://www.renater.fr/Video/2002ATHENS/ ... G/plan.htm Quote My DeviantArt | My Pictorium | My Plugins | Donate via Paypal
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.