public InkTextStroke(InkObject ink, StylusPointCollection stylusPoints) : base(ink, stylusPoints) { InkText ink1 = ink as InkText; ink1.TextIndex = 0; }
public InkRectangleStroke(InkObject ink, StylusPointCollection stylusPoints) : base(ink, stylusPoints) { if (ink.myInkCanvas.isFromFileInk == false) { this.RemoveDirtyStylusPoints(); } }
public InkObjectStroke(InkObject ink, StylusPointCollection stylusPoints) : base(stylusPoints) { this.ink = ink; inkTool = ink.CreateFromInkData(ink.inkTool); this.DrawingAttributes = ink.inkDA.Clone(); this.DrawingAttributes.Color = ink.myInkCanvas.fillColor; }
public InkEllipseCurveStroke(InkObject ink, StylusPointCollection stylusPoints) : base(ink, stylusPoints) { }
public InkCurveStroke(InkObject ink, StylusPointCollection stylusPoints) : base(ink, stylusPoints) { this.DrawingAttributes.FitToCurve = true; }
/// <summary>初始化墨迹绘制时需要的信息</summary> public void SetInkAttributes(string name) { switch (name) { //---------------墨迹类型--------------------- case "球形": ink = new InkEllipse(this, true); UpdateInkParams(); this.EditingMode = InkCanvasEditingMode.Ink; break; case "矩形": ink = new InkRectangle(this, false); UpdateInkParams(); this.EditingMode = InkCanvasEditingMode.Ink; break; case "图像": ink = new InkImage(this, true, "images/flower.jpg"); UpdateInkParams(); this.EditingMode = InkCanvasEditingMode.Ink; break; case "球形序列": ink = new InkEllipseCurve(this, true); UpdateInkParams(); this.EditingMode = InkCanvasEditingMode.Ink; break; case "矩形序列": ink = new InkRectangleCurve(this, true); UpdateInkParams(); this.EditingMode = InkCanvasEditingMode.Ink; break; case "图像序列": ink = new InkImageCurve(this, true); UpdateInkParams(); this.EditingMode = InkCanvasEditingMode.Ink; break; case "直线": ink = new InkLine(this, false); UpdateInkParams(); this.EditingMode = InkCanvasEditingMode.Ink; break; case "曲线": ink = new InkCurve(this, true); UpdateInkParams(); this.EditingMode = InkCanvasEditingMode.Ink; break; case "文字": ink = new InkText(this, true); UpdateInkParams(); this.EditingMode = InkCanvasEditingMode.Ink; break; //---------------笔尖类型--------------------- case "圆笔": isFromFileInk = false; this.myData.inkStylusType = InkStylusType.圆笔; UpdateInkParams(); this.EditingMode = InkCanvasEditingMode.Ink; break; case "竖笔": isFromFileInk = false; this.myData.inkStylusType = InkStylusType.竖笔; UpdateInkParams(); this.EditingMode = InkCanvasEditingMode.Ink; break; case "横笔": isFromFileInk = false; this.myData.inkStylusType = InkStylusType.横笔; UpdateInkParams(); this.EditingMode = InkCanvasEditingMode.Ink; break; case "钢笔": isFromFileInk = false; this.myData.inkStylusType = InkStylusType.钢笔; UpdateInkParams(); this.EditingMode = InkCanvasEditingMode.Ink; break; //---------------笔尖颜色--------------------- case "红色": isFromFileInk = false; myData.inkColor = Colors.Red; UpdateInkParams(); this.EditingMode = InkCanvasEditingMode.Ink; break; case "绿色": isFromFileInk = false; myData.inkColor = Colors.Green; UpdateInkParams(); this.EditingMode = InkCanvasEditingMode.Ink; break; case "蓝色": isFromFileInk = false; myData.inkColor = Colors.Blue; UpdateInkParams(); this.EditingMode = InkCanvasEditingMode.Ink; break; //---------------笔尖大小------------------------ case "2": case "6": case "12": case "18": case "24": case "30": isFromFileInk = false; myData.inkRadius = double.Parse(name); UpdateInkParams(); this.EditingMode = InkCanvasEditingMode.Ink; break; //---------------填充颜色------------------------ case "线性渐变": isFromFileInk = false; myData.inkBrushType = InkBrushType.线性渐变; UpdateInkParams(); this.EditingMode = InkCanvasEditingMode.Ink; break; case "仿射渐变": isFromFileInk = false; myData.inkBrushType = InkBrushType.仿射渐变; UpdateInkParams(); this.EditingMode = InkCanvasEditingMode.Ink; break; case "纯色": isFromFileInk = false; myData.inkBrushType = InkBrushType.纯色; UpdateInkParams(); this.EditingMode = InkCanvasEditingMode.Ink; break; //---------------绘制选项------------------------ case "全部": isFromFileInk = false; myData.inkDrawOption = InkDrawOption.全部; UpdateInkParams(); this.EditingMode = InkCanvasEditingMode.Ink; break; case "仅填充": isFromFileInk = false; myData.inkDrawOption = InkDrawOption.仅填充; UpdateInkParams(); this.EditingMode = InkCanvasEditingMode.Ink; break; case "仅轮廓": isFromFileInk = false; myData.inkDrawOption = InkDrawOption.仅轮廓; UpdateInkParams(); this.EditingMode = InkCanvasEditingMode.Ink; break; //---------------缩放选择--------------------- case "套索选择": isFromFileInk = false; this.UseCustomCursor = false; this.EditingMode = InkCanvasEditingMode.Select; break; case "全选": isFromFileInk = false; this.UseCustomCursor = false; this.Select(Strokes); this.EditingMode = InkCanvasEditingMode.Select; break; case "全不选": isFromFileInk = false; this.UseCustomCursor = false; ClearSelected(); this.EditingMode = InkCanvasEditingMode.None; break; //---------------橡皮擦--------------------- case "墨迹擦除": isFromFileInk = false; this.UseCustomCursor = false; foreach (Stroke v in Strokes) { v.DrawingAttributes.Color = Colors.RoyalBlue; } this.EditingMode = InkCanvasEditingMode.EraseByPoint; break; case "笔画擦除": isFromFileInk = false; this.UseCustomCursor = false; foreach (Stroke v in Strokes) { v.DrawingAttributes.Color = Colors.RoyalBlue; } this.EditingMode = InkCanvasEditingMode.EraseByStroke; break; case "全部删除": isFromFileInk = false; this.UseCustomCursor = false; this.Strokes.Clear(); this.EditingMode = InkCanvasEditingMode.None; break; } }
public InkRectangleCurveStroke(InkObject ink, StylusPointCollection stylusPoints) : base(ink, stylusPoints) { }