问题描述:

I am trying to make a drawing app. The purpose is simple. Let the user draw something on a canvas with various brush options like square brush,far brush,pencil brush and many more like any other drawing app available in android market. At present I can let the user draw smooth curves using following code:

 currentPoint = e.GetPosition(this.canvas);

Line line = new Line() { X1 = currentPoint.X, Y1 = currentPoint.Y, X2 = oldPoint.X, Y2 = oldPoint.Y };

line.Stroke = new SolidColorBrush(Colors.Purple);

line.StrokeThickness = 2;

this.drawnImage.Add(line);

this.canvas.Children.Add(line);

oldPoint = currentPoint;

Now I want some custom brush options and let the user draw using that.How can I achieve that?

Thanks in advance.

网友答案:

Square, Pencil etc are merely custom image pattern used as brush. Go with ImageBrush

相关阅读:
Top