Regarding this line:
|
BitmapData d = Picture.LockBits(new Rectangle(0, 0, Picture.Width, Picture.Height), System.Drawing.Imaging.ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb); |
There's no corresponding UnlockBits call. Picture.UnlockBits(d); needs to be added before line 591, or else a memory leak or access violation could occur.