【发布时间】:2011-08-02 03:41:37
【问题描述】:
我将图像渲染到 System.Drawing.Bitmap 中,然后将其绘制到窗口中,但是我可以看到边缘被消除锯齿。如何预防?
更多细节。位图是这样创建的:
new Bitmap (this.Width, this.Height, Imaging.PixelFormat.Format32bppArgb)
然后我将像素设置为 Color.Black 或 Color.White。我尝试使用 Bitmap.SetPixel 并使用 Bitmap.LockBits 将字节直接写入位图数据。
位图准备好后,我在 Form.OnPaint 覆盖中绘制它:
pea.Graphics.DrawImage
( !this.bitmap
, this.ClientRectangle
, new Rectangle (0, 0, this.Width, this.Height)
, GraphicsUnit.Pixel
)
每个像素都应该是黑色或白色,但我可以看到边缘的像素是灰色的。
【问题讨论】:
标签: c# .net windows graphics gdi+