2 using System.Collections;
3 using System.Collections.Generic;
7 using System.Threading.Tasks;
9 using System.Windows.Media;
10 using System.Windows.Shapes;
21 ArrayList ret =
new ArrayList();
25 System.Reflection.Assembly myAssembly = System.Reflection.Assembly.GetExecutingAssembly();
26 Stream myStream = myAssembly.GetManifestResourceStream(
"ShapeLib.icons.arrow.png");
27 ui.
image =
new System.Drawing.Bitmap(myStream);
52 Point point1 =
new Point();
53 Point point2 =
new Point();
54 Point point3 =
new Point();
55 point1.X = data.
controlBtn4.X - ((num3 * Math.Sin(num1 - num2)));
56 point1.Y = data.
controlBtn4.Y - ((num3 * Math.Cos(num1 - num2)));
57 point2.X = data.
controlBtn4.X - ((num3 * Math.Sin(num1 + num2)));
58 point2.Y = data.
controlBtn4.Y - ((num3 * Math.Cos(num1 + num2)));
59 point3.X = point1.X - (point1.X - point2.X) / 2;
60 point3.Y = point1.Y - (point1.Y - point2.Y) / 2;
61 Polyline myArr =
new Polyline();
68 PointCollection Points =
new PointCollection();
78 myArr.Points =
new PointCollection(Points);
80 myArr.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
81 myArr.VerticalAlignment = VerticalAlignment.Center;
95 Polyline myArr = (Polyline)gv.
baseShape[0];
96 PointCollection Points =
new PointCollection();
100 Point point1 =
new Point();
101 Point point2 =
new Point();
102 Point point3 =
new Point();
103 point1.X = data.
controlBtn4.X - ((num3 * Math.Sin(num1 - num2)));
104 point1.Y = data.
controlBtn4.Y - ((num3 * Math.Cos(num1 - num2)));
105 point2.X = data.
controlBtn4.X - ((num3 * Math.Sin(num1 + num2)));
106 point2.Y = data.
controlBtn4.Y - ((num3 * Math.Cos(num1 + num2)));
107 point3.X = point1.X - (point1.X - point2.X) / 2;
108 point3.Y = point1.Y - (point1.Y - point2.Y) / 2;
116 myArr.Points =
new PointCollection(Points);
131 Point point1 =
new Point();
132 Point point2 =
new Point();
133 Point point3 =
new Point();
134 point1.X = data.
controlBtn4.X - ((num3 * Math.Sin(num1 - num2)));
135 point1.Y = data.
controlBtn4.Y - ((num3 * Math.Cos(num1 - num2)));
136 point2.X = data.
controlBtn4.X - ((num3 * Math.Sin(num1 + num2)));
137 point2.Y = data.
controlBtn4.Y - ((num3 * Math.Cos(num1 + num2)));
138 point3.X = point1.X - (point1.X - point2.X) / 2;
139 point3.Y = point1.Y - (point1.Y - point2.Y) / 2;
140 Polyline myArr =
new Polyline();
143 myArr.Stroke =
new SolidColorBrush(System.Windows.Media.Color.FromRgb(0, 255, 255));
146 PointCollection Points =
new PointCollection();
156 myArr.Points =
new PointCollection(Points);
158 myArr.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
159 myArr.VerticalAlignment = VerticalAlignment.Center;
175 PointCollection Points =
new PointCollection();
179 Point point1 =
new Point();
180 Point point2 =
new Point();
181 Point point3 =
new Point();
182 point1.X = data.
controlBtn4.X - ((num3 * Math.Sin(num1 - num2)));
183 point1.Y = data.
controlBtn4.Y - ((num3 * Math.Cos(num1 - num2)));
184 point2.X = data.
controlBtn4.X - ((num3 * Math.Sin(num1 + num2)));
185 point2.Y = data.
controlBtn4.Y - ((num3 * Math.Cos(num1 + num2)));
186 point3.X = point1.X - (point1.X - point2.X) / 2;
187 point3.Y = point1.Y - (point1.Y - point2.Y) / 2;
195 myArr.Points =
new PointCollection(Points);
RibbonControlEventHandler click
override void DisplayControlPoints(gView gv, gPath data)
string belong
判斷按下Button控制項
System.Windows.Point controlBtn4
某一類的形狀.包含UI 的界面,繪製方式.更新方式.新增方式
void myLine_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
void myLine_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
override System.Collections.ArrayList getMenuItem()
覆寫System.Collections.ArrayList
System.Windows.Point controlBtn1
void myLine_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
void btn_Click(object sender, RibbonControlEventArgs e)
UI 點選
System.Drawing.Image image
List< Shape > controlShape
override void DrawShape(gView gv, gPath data, Boolean bfirst)
依data 繪製,如果是第一次畫要新建shape, 更新的話只要更新最後一點