赞
踩
如果只是简单设置可以直接使用属性:
this.inkCanvas.DefaultDrawingAttributes.Width = 10;
this.inkCanvas.DefaultDrawingAttributes.Height = 10;
上面的表示画刷的宽度和高度为10,不过简易使用DrawingAttributes
:
drawingAttributes = new DrawingAttributes(); //简易放到属性上
drawingAttributes.Width = 10;
drawingAttributes.Height = 10;
this.inkCanvas.DefaultDrawingAttributes = drawingAttributes;
设置画笔颜色:
drawingAttributes.Color = Colors.Red
//要是不生效加一句话
//this.inkCanvas.DefaultDrawingAttributes = this.drawingAttributes;
设置橡皮擦模式:
this.inkCanvas.EditingMode = InkCanvasEditingMode.EraseByStroke;
设置画笔模式:
this.inkCanvas.EditingMode = InkCanvasEditingMode.Ink;
清空画板:
this.inkCanvas.Strokes.Clear();
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。