您好
我想图像处理在WPF
我发现没有办法适用于除getpixel功能:
但由于此功能是一个循环内运行,它是很慢的。public Color GetPixel(BitmapSource bitmap, int x, int y)
{
CroppedBitmap cb = new CroppedBitmap(bitmap, new Int32Rect(x, y, 1, 1));
byte[] pixel = new byte[bitmap.Format.BitsPerPixel / 8];
cb.CopyPixels(pixel, bitmap.Format.BitsPerPixel / 8, 0);
return Color.FromRgb(pixel[2], pixel[1], pixel[0]);
}
有任何方式使其快速?