MSDN的代码 COLORREF pixel; int maxY = imgOriginal.GetHeight(), maxX = imgOriginal.GetWidth(); byte r,g,b,avg; for (int y=0; y<maxY; y++) { for (int x=0; x<maxX; x++) { pixel = imgOriginal.GetPixel(x,y); r = GetRValue(pixel); g = GetGValue(pixel); b = G…