跪求ReleaseHdc使用方法
Rectangle rect1 = new Rectangle(0, 0, srcBitmap1.Width, srcBitmap1.Height);
Rectangle rect2 = new Rectangle(0, 0, srcBitmap2.Width, srcBitmap2.Height);
BitmapData bmpIn1 = srcBitmap1.LockBits(rect1, ImageLockMode.ReadWrite, srcBitmap1.PixelFormat);
IntPtr ptr1 = bmpIn1.Scan0;
int bytes1 = srcBitmap1.Width * srcBitmap1.Height;
byte[] grayValues1 = new byte[bytes1];
System.Runtime.InteropServices.Marshal.Copy(ptr1, grayValues1, 0, bytes1);
BitmapData bmpIn2 = srcBitmap2.LockBits(rect2, ImageLockMode.ReadWrite, srcBitmap2.PixelFormat);
IntPtr ptr2 = bmpIn2.Scan0;
int bytes2 = srcBitmap2.Width * srcBitmap2.Height;
byte[] grayValues2 = new byte[bytes2];
System.Runtime.InteropServices.Marshal.Copy(ptr2, grayValues2, 0, bytes2);
BitmapData bmpIn2 = srcBitmap2.LockBits(rect2, ImageLockMode.ReadWrite, srcBitmap2.PixelFormat);
这里提示
如果在使用 GetHdc 方法后使用 Graphics 对象,请调用 ReleaseHdc 方法。
这将释放上一次调用 Graphics 对象的 GetHdc 方法时所获得的上下文句柄。
请问我哪里使用了GETHDC??
并且该如何调用RELEASEHDC呢????谢谢高手解答!!!