1
这是我的代码:的PixelFormat convertation麻烦
BitmapData bmpData = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
UnmanagedImage img = new UnmanagedImage(bmpData);
//MAIN BLOCK
BayerDithering filter = new BayerDithering();
img = new UnmanagedImage(img.ImageData, img.Width, img.Height, img.Stride, PixelFormat.Format8bppIndexed);
filter.ApplyInPlace(img);
//END MAIN BLOCK
bitmap.UnlockBits(bmpData);
这是结果:screenshot
为什么结果不complited吴?而我必须改变只有在“MAIN BLOCK”?
我怀疑这段代码会产生你给出的截图。你正在分别使用'img'和'_img' .. – 2013-04-07 06:42:53
对不起,这是我的失误 – GLeBaTi 2013-04-07 06:52:00
你把它锁定在24bpp,你的过滤器在8bpp上应用它。你期望结果是什么? – 2013-04-07 07:13:13