Hi All,
Can anyone shed any light on whats going on here?
I have a windows form, which loads a bitmap stored in:
Bitmap bOriginalImage;
I then create a clost
Bitmap backBuffer = bOriginalImage();
this backbuffer is then used in the paint method to display the image in a panel on the form.
I then want to do some analysis on the original file in another thread, as such:
ThreadStart starter = delegate { da.analyse(bOriginalImage); };
Thread t = new Thread(starter);
During the analysis (which takes a few minutes) everything is fine, until something happens to cause the panel to be repainted.
Then I get a runtime error:
System.InvalidOperationException was unhandled
Message="Bitmap region is already locked."
I don't know why, because I assumed that the painting and the analysis were being done on separate copies of the bitmap.
What am I missing?!
Thanks
Just assigning the bitmap to another variable does not create a copy, try creating a copy explicitly using the Clone method. Maybe it will help.
Sorry, I screwed up my original post. It should read:
I then create a clone
Bitmap backBuffer = bOriginalImage.clone();
That's what puzzles me!
In that case, I have no idea what could be wrong. Maybe the form still has a reference to the original somehow.
Find out how Vista icons differ from XP icons.
See how RealWorld Icon Editor handles Vista icons.