【发布时间】:2018-11-07 14:00:59
【问题描述】:
作为this previous question 上的suggested by @TaW,我设置PenAlignment.Inset 在位图内绘制圆圈,但这又引发了另一个问题。
我想用抗锯齿在指定的位图上画一个圆。
SmoothingMode.AntiAlias
问题是,当我使用PenAlignment.Inset 时,抗锯齿功能无法正常工作!
相反,使用PenAlignment.Center,它可以正常工作...
有什么解决这个问题的建议吗?
Bitmap layer = new Bitmap(80, 80);
using (Graphics g = Graphics.FromImage(layer))
{
using (Pen p = new Pen(Color.Black, 4))
{
p.Alignment = PenAlignment.Inset;
g.SmoothingMode = SmoothingMode.AntiAlias;
g.DrawEllipse(p, new Rectangle(0, 0, layer.Width, layer.Height));
}
}
pictureBox3.Size = new Size(100, 100);
pictureBox3.Image = layer;
【问题讨论】:
标签: c# bitmap antialiasing graphic drawellipse