???????
???????????????淨???????????????LockBits?????????λ????????????????????????????????λ????????????????????????unsafe????в?????
if (bitmap != null)
{
newbitmap = bitmap.Clone() as Bitmap;
Rectangle rect = new Rectangle(0?? 0?? newbitmap.Width?? newbitmap.Height);
System.Drawing.Imaging.BitmapData bmpdata = newbitmap.LockBits(rect?? System.Drawing.Imaging.ImageLockMode.ReadWrite?? newbitmap.PixelFormat);
byte temp;
unsafe
{
byte* ptr = (byte*)(bmpdata.Scan0);
for (int x = 0; x < bmpdata.Width; x++)
{
for (int y = 0; y < bmpdata.Height; y++)
{
temp = (byte)(0.299 * ptr[2] + 0.587 * ptr[1] + 0.114 * ptr[0]);
ptr[0] = ptr[1] = ptr[2] = temp;
ptr += 3;
}
ptr += bmpdata.Stride - bmpdata.Width * 3;
}
}
newbitmap.UnlockBits(bmpdata);
pictureBox1.Image = newbitmap.Clone() as Image;
}
????3?????????

?????????????ó????????????????????????Ч????????淨Ч?????????????????????????????Ч?????淨?????Щ??????????????????????淨?????Ч????????????C#????????