2 using System.Collections;
3 using System.Collections.Generic;
6 using System.Threading.Tasks;
8 using System.Windows.Media;
9 using System.Windows.Shapes;
20 ArrayList ret =
new ArrayList();
25 System.Reflection.Assembly myAssembly = System.Reflection.Assembly.GetExecutingAssembly();
26 System.IO.Stream myStream = myAssembly.GetManifestResourceStream(
"ShapeLib.icons.curve.png");
27 ui.
image =
new System.Drawing.Bitmap(myStream);
48 BezierSegment bezier =
new BezierSegment();
50 PathFigure figure =
new PathFigure();
52 bezier.Point1 = figure.StartPoint;
53 bezier.Point2 = bezier.Point3;
54 figure.Segments.Add(bezier);
55 PathGeometry geometry =
new PathGeometry();
56 geometry.Figures.Add(figure);
57 Path myPath =
new System.Windows.Shapes.Path();
58 SolidColorBrush mySolidColorBrush =
new SolidColorBrush();
67 myPath.Data = geometry;
74 PathGeometry geometry = (PathGeometry)myPath.Data;
76 BezierSegment bs = (BezierSegment)geometry.Figures[0].Segments[0];
87 BezierSegment bezier =
new BezierSegment();
89 PathFigure figure =
new PathFigure();
91 bezier.Point1 = figure.StartPoint;
92 bezier.Point2 = bezier.Point3;
93 figure.Segments.Add(bezier);
94 PathGeometry geometry =
new PathGeometry();
95 geometry.Figures.Add(figure);
96 Path myPath =
new System.Windows.Shapes.Path();
97 myPath.Stroke =
new SolidColorBrush(System.Windows.Media.Color.FromRgb(255, 0, 255));
102 myPath.Data = geometry;
111 PathGeometry geometry = (PathGeometry)myPath.Data;
113 BezierSegment bs = (BezierSegment)geometry.Figures[0].Segments[0];
RibbonControlEventHandler click
string belong
判斷按下Button控制項
System.Windows.Point controlBtn3
override void DisplayControlPoints(gView gv, gPath data)
System.Windows.Point controlBtn4
某一類的形狀.包含UI 的界面,繪製方式.更新方式.新增方式
System.Windows.Point controlBtn2
System.Windows.Point controlBtn1
void btn_Click(object sender, RibbonControlEventArgs e)
UI 點選
System.Drawing.Image image
override System.Collections.ArrayList getMenuItem()
覆寫System.Collections.ArrayList
List< Shape > controlShape
override void DrawShape(gView gv, gPath data, Boolean bfirst)
依data 繪製,如果是第一次畫要新建shape, 更新的話只要更新最後一點