我试着关了 Graphics.InterpolationMode, Graphics.SmoothingMode, Graphics.PixelOffsetMode, Graphics.TextRenderingHint但是图像放大后仍然有平滑的效果, 怎么样才能做到像msPaint 中放大的图像那样显示真实的像素颜色并且有明显的锯齿?

解决方案 »

  1.   

    Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
    Graphics.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Half;
    这样做看看.
      

  2.   

                    pe.Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.Default;
                    pe.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.Default;
                    pe.Graphics.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.None;
                    pe.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixel;Graphics.DrawImage(Image, array<Point>[]()[], Rectangle, GraphicsUnit.Pixel)图像本身没有问题, 在msPaint下放大可以看到明显的锯齿, 但是用这个方法画出来的不管怎么放大都是平滑的。
      

  3.   

    经测试这个有效。Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor; 谢谢了