I'm writing a very simple draw on screen tool. When I have my thickness to a low value, it looks pretty smooth, but when I go to a larger size, the lines become super jagged (see below)
Line line = new Line();
Brush brush = new SolidColorBrush(Colors.Red);
line.Stroke = brush;
line.X1 = currentPoint.X;
line.Y1 = currentPoint.Y;
line.X2 = e.GetPosition(this).X;
line.Y2 = e.GetPosition(this).Y;
line.StrokeThickness = 40;
currentPoint = e.GetPosition(this);
paintSurface.Children.Add(line);
see image at: http://ift.tt/1I684Dq (can't post yet, I'm new)
My original app is a WinForms app. I tried to redo it in WPF, hoping that it would be better, but the above is from the WPF app - exactly the same problem. Is there any way that I get a better looking line?
Code in WinForm:
penDraw = new Pen(Color.Black, 20);
using (Graphics g = this.CreateGraphics())
{
g.DrawLine(penDraw, pt, ptLast);
}
Aucun commentaire:
Enregistrer un commentaire