Bitmap Region Blocking C#

227 views Asked by At

I am currently writing an program to Filter pictures. To make my program faster I split a picture into multiple Regions. To do that I block regions with the method LockBits.

 BitmapData data1 = inputimage.LockBits(new Rectangle(0, 0, image.Width, 100), ImageLockMode.ReadWrite, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
 BitmapData data2 = inputimage.LockBits(new Rectangle(0, 200, image.Width, 100), ImageLockMode.ReadWrite, System.Drawing.Imaging.PixelFormat.Format32bppArgb);

If I run this Code I get the Exception (if the second code line is executing), I get the exception that this region is already locked. For me it makes no sense. This region is not blocked, but i get the message that it is.

Can anyone help me?? Marcel

0

There are 0 answers