日期:2014-05-17 浏览次数:21139 次
//读取水印图片的像素数组
Rectangle arect = new Rectangle(0, 0, a.Width, a.Height);
System.Drawing.Imaging.BitmapData aData = a.LockBits(rect, System.Drawing.Imaging.ImageLockMode.ReadWrite, a.PixelFormat);
//Get the address of the first line.
IntPtr aptr = aData.Scan0;
// Declare an array to hold the bytes of the bitmap.
int abytes = a.Width * a.Height;//水印图像像素个数
byte[] ArgbValues = new byte[abytes];//水印图像像素数组
// Copy the RGB values into the array.
System.Runtime.InteropServices.Marshal.Copy(aptr, ArgbValues, 0, abytes);