Reply to thread

I just downloaded the MP source code and just looking around in it. Hopefully create a plugin sometime soon.


I noticed one thing in the source code about how you load the images.


This is usually done this way in MP

[code]

using (Image img = Image.FromFile(fileName))

{

    //do stuff

}

[/code]


What is a great way to load images, maybe 100 times faster, is this way


[code]

using (FileStream fs = new FileStream(fullName, FileMode.Open, FileAccess.Read))

{

    using (Image g = Image.FromStream(fs, true, false))

       {

            //do stuff

       }

}

[/code]


The reason this is alot faster is that Image.FromFile(fileName) does some type of check on the image.


You can read more about it on this blog http://blogs.msdn.com/omars/archive/2004/03/29/100941.aspx


Top Bottom