如何使的drawLine顺畅? [英] How to make drawLine smoother?

查看:109
本文介绍了如何使的drawLine顺畅?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用下面的代码画线:

Graphics g = this.CreateGraphics();
Pen p = new Pen(Color.Black,3);
g.DrawLine(p,...);
// ...



为什么直线锯齿样的,不平直平滑的。我怎么能使其直接和更流畅的?

Why the straight line is zigzag kind of, not straight and smooth at all. How could I make it straight and smoother?

推荐答案

您需要启用抗锯齿。这里说明设置 Graphics.Smoothi​​ngMode 消除锯齿http://msdn.microsoft.com/en-us/library/system.drawing.graphics.smoothi​​ngmode.aspx

You need to enable anti-aliasing. Set Graphics.SmoothingMode to AntiAlias as described here: http://msdn.microsoft.com/en-us/library/system.drawing.graphics.smoothingmode.aspx

这篇关于如何使的drawLine顺畅?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆