2 using System.Collections;
3 using System.Collections.Generic;
6 using System.Threading.Tasks;
8 using System.Windows.Input;
9 using System.Windows.Media;
10 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.eraser.png");
27 ui.
image =
new System.Drawing.Bitmap(myStream);
39 return (1 - u) * (1 - u) * (1 - u) / 6;
44 return (3 * u * u * u - 6 * u * u + 4) / 6;
48 return (-3 * u * u * u + 3 * u * u + 3 * u + 1) / 6;
68 Path myPath =
new System.Windows.Shapes.Path();
69 PathGeometry geometry = (PathGeometry)myPath.Data;
82 BezierSegment bezier =
new BezierSegment();
83 PathFigure figure =
new PathFigure();
87 for (
int a = 0; a < 4; a++)
98 for (
int i = 0; i <
m - 3; i++)
110 double Qx =
B0(u) *
myarr[i].X +
115 double Qy =
B0(u) *
myarr[i].Y +
131 figure.Segments.Add(bezier);
132 PathGeometry geometry =
new PathGeometry();
133 geometry.Figures.Add(figure);
136 SolidColorBrush mySolidColorBrush =
new SolidColorBrush();
140 Path myPath =
new System.Windows.Shapes.Path();
146 myPath.Data = geometry;
158 PathGeometry geometry = (PathGeometry)myPath.Data;
159 if (geometry !=
null)
161 BezierSegment bs = (BezierSegment)geometry.Figures[0].Segments[0];
163 geometry.Figures[0].StartPoint =
myarr[0];
164 bs.Point1 =
myarr[1];
166 bs.Point3 =
myarr[3];
RibbonControlEventHandler click
string belong
判斷按下Button控制項
System.Windows.Point controlBtn4
System.Windows.Point controlBtn1
void btn_Click(object sender, RibbonControlEventArgs e)
UI 點選
override void DrawShape(gView gv, gPath data, Boolean bfirst)
依data 繪製,如果是第一次畫要新建shape, 更新的話只要更新最後一點
override System.Collections.ArrayList getMenuItem()
覆寫System.Collections.ArrayList
System.Drawing.Image image