http://www.dotnet247.com/247reference/message.aspx?id=286412
The clean solution would be to use generics, but 2.0 has not been released yet.
You could add a public function to your derived classes, and an abstract function in the base class, to do the same work as your class constructor...
What you are talking about is similar to double buffering.
using System.Drawing;
...
private Bitmap _Buffer;
...
//I suggest doing this in a constructor somewhere
_Buffer = new Bitmap(width, height);
Graphics g = Graphics.FromImage(_Buffer);
//draw stuff
//ex: g.FillRectangle(Brushes.Green, 0...
Your locking problem is not in the code you provided. I assume you are using Image.FromFile to load the file into an Image type. Image.FromFile does not release the file after reading it.
I suggest you handle the filestream yourself.
using System.IO;
using System.Drawing;
...
FileStream f =...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.