GrainContoursEditingDialog.cs 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117
  1. using OpenCvSharp;
  2. using PaintDotNet.Adjust;
  3. using PaintDotNet.Adjust.BaseImage;
  4. using PaintDotNet.Base.Functionodel;
  5. using PaintDotNet.CustomControl;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.ComponentModel;
  9. using System.Data;
  10. using System.Drawing;
  11. using System.Drawing.Drawing2D;
  12. using System.Linq;
  13. using System.Text;
  14. using System.Threading.Tasks;
  15. using System.Windows.Forms;
  16. using Point = System.Drawing.Point;
  17. namespace PaintDotNet.DedicatedAnalysis.NonferrousMetals.YYT098814_2016
  18. {
  19. internal class GrainContoursEditingDialog : Form
  20. {
  21. /// <summary>
  22. /// 公共按钮
  23. /// </summary>
  24. private CommonControlButtons commonControlButtons;
  25. /// <summary>
  26. /// 主控件
  27. /// </summary>
  28. private AppWorkspace appWorkspace;
  29. private DocumentWorkspaceWindow documentWorkspace;
  30. /// <summary>
  31. /// 外接矩形,或者是计算的矩形
  32. /// </summary>
  33. protected RectangleF rectangle = new RectangleF();
  34. /// <summary>
  35. /// 存在视场标记
  36. /// </summary>
  37. private bool existViewFlag = false;
  38. /// <summary>
  39. /// 选中图片的bitmap
  40. /// </summary>
  41. private Bitmap bitmap;
  42. /// <summary>
  43. /// 当前选择的图片
  44. /// </summary>
  45. private Mat mat;
  46. /// <summary>
  47. /// 用于get处理后的图像
  48. /// </summary>
  49. private Mat phaseMat;
  50. Color phaseColor;
  51. /// <summary>
  52. /// 操作类型
  53. /// 0,没有操作 1,折线添加 2,直线添加
  54. /// 11,多边形删除 12,圆形删除 13,矩形删除 14,椭圆删除
  55. /// </summary>
  56. private int pointKtype = 0;
  57. /// <summary>
  58. /// 起始点
  59. /// </summary>
  60. private Point startPoint = new Point(-1, -1);
  61. /// <summary>
  62. /// 结束点
  63. /// </summary>
  64. private Point endPoint = new Point(-1, -1);
  65. /// <summary>
  66. /// 检测到的轮廓
  67. /// </summary>
  68. OpenCvSharp.Point[][] contours;
  69. int contoursTop = 0;
  70. int contoursLeft = 0;
  71. int contoursWidth = 1;
  72. /// <summary>
  73. /// 折线点的集合
  74. /// </summary>
  75. public List<Point> pointArray = new List<Point>();
  76. //1013###19326 晶粒度的轮廓编辑页面,需要把辅助线带过去(客户编辑只处理辅助线位置的轮廓)
  77. /// <summary>
  78. /// 辅助线集成
  79. /// </summary>
  80. private GrainSizeStandard.IntegrationClass.GrainSizeGuideClass guideClass;
  81. public object SelectedItem;
  82. private GroupBox groupBox1;
  83. private GroupBox groupBox2;
  84. private GroupBox groupBox3;
  85. private Button button2;
  86. private Button button1;
  87. private Button button3;
  88. private Button button4;
  89. private Button button8;
  90. private Button button7;
  91. private Button button6;
  92. private Button button5;
  93. private Button button9;
  94. private GroupBox groupBox7;
  95. public GrainSizeStandard.IntegrationClass.GrainSizeGuideClass GuideClass
  96. {
  97. set
  98. {
  99. this.guideClass = value;
  100. }
  101. }
  102. public GrainContoursEditingDialog(AppWorkspace appWorkspace, int focusedItemIndex, Color phaseColor, Mat phaseMat, OpenCvSharp.Point[][] contours, int contoursTop, int contoursLeft, int contoursWidth)
  103. {
  104. this.appWorkspace = appWorkspace;
  105. InitializeComponent();
  106. InitializeLanguageText();
  107. //
  108. //初始化图像控件
  109. //
  110. this.documentWorkspace = new DocumentWorkspaceWindow(appWorkspace);
  111. this.documentWorkspace.Dock = DockStyle.Fill;
  112. this.documentWorkspace.HookMouseEvents();
  113. this.documentWorkspace.AuxiliaryLineEnabled = false;
  114. this.documentWorkspace.Visible = false;
  115. this.documentWorkspace.panel.MouseDown += OnMouseDown;
  116. this.documentWorkspace.panel.Paint += Panel_Paint;
  117. this.documentWorkspace.panel.MouseMove += onMouseMove;
  118. this.documentWorkspace.panel.MouseUp += onMouseUp;
  119. this.documentWorkspace.panel.Click += new EventHandler(this.pictureBox1_Click);
  120. this.groupBox7.Controls.Add(documentWorkspace);
  121. //
  122. //初始化操作按钮
  123. //
  124. this.commonControlButtons = new CommonControlButtons();
  125. this.commonControlButtons.Dock = DockStyle.Top;
  126. this.commonControlButtons.Height = 30;
  127. this.commonControlButtons.HideZoomToWindowAndActualSize();
  128. this.groupBox7.Controls.Add(commonControlButtons);
  129. this.phaseColor = phaseColor;
  130. {
  131. //
  132. //初始化相
  133. //
  134. PhaseModel model = new PhaseModel();
  135. model.choise = true;
  136. model.mat = null;
  137. model.color = phaseColor.ToArgb();// Color.Green/*panel2.BackColor*/.ToArgb();
  138. model.position = this.documentWorkspace.PhaseModels.Count + 1;
  139. model.name = PdnResources.GetString("Menu.Outlinetoreproduce.Text");
  140. this.documentWorkspace.PhaseModels.Add(model);
  141. }
  142. this.contours = contours;
  143. this.contoursTop = contoursTop;
  144. this.contoursLeft = contoursLeft;
  145. this.contoursWidth = contoursWidth;
  146. this.documentWorkspace.PhaseModels[0].mat = phaseMat;
  147. this.documentWorkspace.Refresh();
  148. existViewFlag = this.appWorkspace.DocumentWorkspaces[focusedItemIndex].GraphicsList.IsExsitView();
  149. this.bitmap = this.appWorkspace.DocumentWorkspaces[focusedItemIndex].CompositionSurface.CreateAliasedBitmap();
  150. if (!existViewFlag)
  151. {
  152. mat = OpenCvSharp.Extensions.BitmapConverter.ToMat(bitmap);
  153. }
  154. else
  155. {
  156. mat = OpenCvSharp.Extensions.BitmapConverter.ToMat(this.appWorkspace.DocumentWorkspaces[focusedItemIndex].GetFullSizeWithRegion());
  157. }
  158. Document document = Document.FromImage(bitmap);
  159. this.documentWorkspace.Document = document;
  160. this.documentWorkspace.Visible = true;
  161. this.documentWorkspace.GraphicsList = this.appWorkspace.DocumentWorkspaces[focusedItemIndex].GraphicsList;
  162. InitCommonButtonEvent();
  163. }
  164. #region 矩形拖动
  165. /// <summary>
  166. /// 鼠标按下
  167. /// </summary>
  168. /// <param name="drawArea"></param>
  169. /// <param name="e"></param>
  170. private void OnMouseDown(object sender, MouseEventArgs e)
  171. {
  172. // 换算后的点
  173. PointF point1 = documentWorkspace.GetScalePoint(e.Location);
  174. if (point1.X <= this.documentWorkspace.CompositionSurface.Width
  175. && point1.X >= 0
  176. && point1.Y >= 0
  177. && point1.Y <= this.documentWorkspace.CompositionSurface.Height)
  178. {
  179. if (e.Button == MouseButtons.Left && this.pointKtype >= 1
  180. && startPoint.X == -1 && startPoint.Y == -1)
  181. startPoint = new Point((int)point1.X, (int)point1.Y);
  182. }
  183. }
  184. /// <summary>
  185. /// 移动
  186. /// </summary>
  187. /// <param name="sender"></param>
  188. /// <param name="e"></param>
  189. private void onMouseMove(object sender, MouseEventArgs e)
  190. {
  191. // 换算后的点
  192. PointF point1 = documentWorkspace.GetScalePoint(e.Location);
  193. if (e.Button == MouseButtons.Left)
  194. {
  195. // 椭圆删除/圆形删除
  196. if ((this.pointKtype == 14 || this.pointKtype == 12) && this.startPoint.X > -1 && this.startPoint.Y > -1)
  197. {
  198. endPoint = new Point((int)point1.X, (int)point1.Y);
  199. if (this.startPoint.X < this.endPoint.X)
  200. {
  201. this.rectangle.X = this.startPoint.X;
  202. this.rectangle.Width = this.endPoint.X - this.startPoint.X;
  203. }
  204. else
  205. {
  206. this.rectangle.X = this.endPoint.X;
  207. this.rectangle.Width = this.startPoint.X - this.endPoint.X;
  208. }
  209. if (this.startPoint.Y < this.endPoint.Y)
  210. {
  211. this.rectangle.Y = this.startPoint.Y;
  212. this.rectangle.Height = this.endPoint.Y - this.startPoint.Y;
  213. }
  214. else
  215. {
  216. this.rectangle.Y = this.endPoint.Y;
  217. this.rectangle.Height = this.startPoint.Y - this.endPoint.Y;
  218. }
  219. this.documentWorkspace.Refresh();
  220. }
  221. // 矩形删除
  222. if (this.pointKtype == 13 && this.startPoint.X > -1 && this.startPoint.Y > -1)
  223. {
  224. endPoint = new Point((int)point1.X, (int)point1.Y);
  225. if (this.startPoint.X < this.endPoint.X)
  226. {
  227. this.rectangle.X = this.startPoint.X;
  228. this.rectangle.Width = this.endPoint.X - this.startPoint.X;
  229. }
  230. else
  231. {
  232. this.rectangle.X = this.endPoint.X;
  233. this.rectangle.Width = this.startPoint.X - this.endPoint.X;
  234. }
  235. if (this.startPoint.Y < this.endPoint.Y)
  236. {
  237. this.rectangle.Y = this.startPoint.Y;
  238. this.rectangle.Height = this.endPoint.Y - this.startPoint.Y;
  239. }
  240. else
  241. {
  242. this.rectangle.Y = this.endPoint.Y;
  243. this.rectangle.Height = this.startPoint.Y - this.endPoint.Y;
  244. }
  245. this.documentWorkspace.Refresh();
  246. }
  247. // 直线添加
  248. if (this.pointKtype == 2 && this.startPoint.X > -1 && this.startPoint.Y > -1)
  249. {
  250. endPoint = new Point((int)point1.X, (int)point1.Y);
  251. this.documentWorkspace.Refresh();
  252. }
  253. }
  254. }
  255. /// <summary>
  256. /// 鼠标抬起
  257. /// </summary>
  258. /// <param name="sender"></param>
  259. /// <param name="e"></param>
  260. private void onMouseUp(object sender, MouseEventArgs e)
  261. {
  262. // 换算后的点
  263. PointF point1 = documentWorkspace.GetScalePoint(e.Location);
  264. if (point1.X <= this.documentWorkspace.CompositionSurface.Width
  265. && point1.X >= 0
  266. && point1.Y >= 0
  267. && point1.Y <= this.documentWorkspace.CompositionSurface.Height) { }
  268. else
  269. return;
  270. if (e.Button == MouseButtons.Right)
  271. {
  272. // 折线删除
  273. if (this.pointKtype == 11 && pointArray.Count > 1)
  274. {
  275. pointArray.Add(new Point((int)point1.X, (int)point1.Y));
  276. endPoint = new Point((int)point1.X, (int)point1.Y);
  277. List<PointF> pointFArray = new List<PointF>();
  278. foreach (var item in pointArray)
  279. {
  280. pointFArray.Add(new PointF(item.X, item.Y));
  281. }
  282. this.documentWorkspace.PhaseModels[0].mat = PreActionIntent.PolygonDelete(this.documentWorkspace.PhaseModels[0].mat, pointFArray);
  283. ////保存处理后的图片
  284. //Bitmap originalBit = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(this.documentWorkspace.PhaseModels[0].mat);
  285. //Bitmap newBit = originalBit.Clone(new Rectangle(0, 0, originalBit.Width, originalBit.Height), originalBit.PixelFormat);
  286. //Graphics graphics = Graphics.FromImage(newBit);
  287. //Draw(graphics);
  288. //this.documentWorkspace.PhaseModels[0].mat/* = phaseMat*/ = OpenCvSharp.Extensions.BitmapConverter.ToMat(newBit);
  289. this.rectangle.X = -1;
  290. this.rectangle.Y = -1;
  291. this.rectangle.Width = 0;
  292. this.rectangle.Height = 0;
  293. pointArray.Clear();
  294. startPoint = new Point(-1, -1);
  295. endPoint = new Point(-1, -1);
  296. this.pointKtype = 0;
  297. this.documentWorkspace.Refresh();
  298. }
  299. // 折线添加
  300. if (this.pointKtype == 1 && pointArray.Count > 1)
  301. {
  302. pointArray.Add(new Point((int)point1.X, (int)point1.Y));
  303. endPoint = new Point((int)point1.X, (int)point1.Y);
  304. //保存处理后的图片
  305. Bitmap originalBit = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(this.documentWorkspace.PhaseModels[0].mat);
  306. Bitmap newBit = originalBit.Clone(new Rectangle(0, 0, originalBit.Width, originalBit.Height), originalBit.PixelFormat);
  307. Graphics graphics = Graphics.FromImage(newBit);
  308. Draw(graphics);
  309. this.documentWorkspace.PhaseModels[0].mat/* = phaseMat*/ = OpenCvSharp.Extensions.BitmapConverter.ToMat(newBit);
  310. pointArray.Clear();
  311. startPoint = new Point(-1, -1);
  312. endPoint = new Point(-1, -1);
  313. this.pointKtype = 0;
  314. this.documentWorkspace.Refresh();
  315. }
  316. }
  317. if (e.Button == MouseButtons.Left)
  318. {
  319. // 圆形删除/椭圆删除
  320. if ((this.pointKtype == 14 || this.pointKtype == 12) && this.startPoint.X > -1 && this.startPoint.Y > -1)
  321. {
  322. endPoint = new Point((int)point1.X, (int)point1.Y);
  323. if (this.startPoint.X < this.endPoint.X)
  324. {
  325. this.rectangle.X = this.startPoint.X;
  326. this.rectangle.Width = this.endPoint.X - this.startPoint.X;
  327. }
  328. else
  329. {
  330. this.rectangle.X = this.endPoint.X;
  331. this.rectangle.Width = this.startPoint.X - this.endPoint.X;
  332. }
  333. if (this.startPoint.Y < this.endPoint.Y)
  334. {
  335. this.rectangle.Y = this.startPoint.Y;
  336. this.rectangle.Height = this.endPoint.Y - this.startPoint.Y;
  337. }
  338. else
  339. {
  340. this.rectangle.Y = this.endPoint.Y;
  341. this.rectangle.Height = this.startPoint.Y - this.endPoint.Y;
  342. }
  343. if (this.pointKtype == 14)
  344. {
  345. //循环处理轮廓的点
  346. if (contours != null && contours.Length > 0)
  347. {
  348. for (int i = 0; i < contours.Count(); i++)
  349. {
  350. OpenCvSharp.Point[] tempLine = contours[i];
  351. if (tempLine != null && tempLine.Length > 1)
  352. {
  353. List<OpenCvSharp.Point> pointsEdit = tempLine.ToList();
  354. for (int y = tempLine.Length - 1; y >= 0; y--)
  355. {
  356. if (BaseTools.isPointInOval(new System.Drawing.Point(tempLine[y].X + contoursLeft, tempLine[y].Y + contoursTop),
  357. new System.Drawing.PointF(rectangle.X + rectangle.Width / 2, rectangle.Y + rectangle.Height / 2),
  358. rectangle.Width / 2,
  359. rectangle.Height / 2
  360. ))
  361. {
  362. pointsEdit.RemoveAt(y);
  363. }
  364. }
  365. contours[i] = pointsEdit.ToArray();
  366. }
  367. }
  368. }
  369. this.documentWorkspace.PhaseModels[0].mat = PreActionIntent.OvalDelete(this.documentWorkspace.PhaseModels[0].mat, this.rectangle);
  370. }
  371. else
  372. {
  373. //循环处理轮廓的点
  374. if (contours != null && contours.Length > 0)
  375. {
  376. for (int i = 0; i < contours.Count(); i++)
  377. {
  378. OpenCvSharp.Point[] tempLine = contours[i];
  379. if (tempLine != null && tempLine.Length > 1)
  380. {
  381. List<OpenCvSharp.Point> pointsEdit = tempLine.ToList();
  382. for (int y = tempLine.Length - 1; y >= 0; y--)
  383. {
  384. RectangleF rectangleF2 = new RectangleF(this.rectangle.X, this.rectangle.Y, Math.Min(this.rectangle.Width, this.rectangle.Height), Math.Min(this.rectangle.Width, this.rectangle.Height));
  385. if (BaseTools.isPointInOval(new System.Drawing.Point(tempLine[y].X + contoursLeft, tempLine[y].Y + contoursTop),
  386. new System.Drawing.PointF(rectangleF2.X + rectangleF2.Width / 2, rectangleF2.Y + rectangleF2.Height / 2),
  387. rectangleF2.Width / 2,
  388. rectangleF2.Height / 2
  389. ))
  390. {
  391. pointsEdit.RemoveAt(y);
  392. }
  393. }
  394. contours[i] = pointsEdit.ToArray();
  395. }
  396. }
  397. }
  398. this.documentWorkspace.PhaseModels[0].mat = PreActionIntent.OvalDelete(this.documentWorkspace.PhaseModels[0].mat
  399. , new RectangleF(this.rectangle.X, this.rectangle.Y, Math.Min(this.rectangle.Width, this.rectangle.Height), Math.Min(this.rectangle.Width, this.rectangle.Height)));
  400. }
  401. this.rectangle.X = -1;
  402. this.rectangle.Y = -1;
  403. this.rectangle.Width = 0;
  404. this.rectangle.Height = 0;
  405. startPoint = new Point(-1, -1);
  406. endPoint = new Point(-1, -1);
  407. this.pointKtype = 0;
  408. this.documentWorkspace.Refresh();
  409. }
  410. // 矩形删除
  411. if (this.pointKtype == 13 && this.startPoint.X > -1 && this.startPoint.Y > -1)
  412. {
  413. endPoint = new Point((int)point1.X, (int)point1.Y);
  414. if (this.startPoint.X < this.endPoint.X)
  415. {
  416. this.rectangle.X = this.startPoint.X;
  417. this.rectangle.Width = this.endPoint.X - this.startPoint.X;
  418. }
  419. else
  420. {
  421. this.rectangle.X = this.endPoint.X;
  422. this.rectangle.Width = this.startPoint.X - this.endPoint.X;
  423. }
  424. if (this.startPoint.Y < this.endPoint.Y)
  425. {
  426. this.rectangle.Y = this.startPoint.Y;
  427. this.rectangle.Height = this.endPoint.Y - this.startPoint.Y;
  428. }
  429. else
  430. {
  431. this.rectangle.Y = this.endPoint.Y;
  432. this.rectangle.Height = this.startPoint.Y - this.endPoint.Y;
  433. }
  434. this.documentWorkspace.PhaseModels[0].mat = PreActionIntent.RectangleDelete(this.documentWorkspace.PhaseModels[0].mat, this.rectangle);
  435. //循环处理轮廓的点
  436. if (contours != null && contours.Length > 0)
  437. {
  438. for (int i = 0; i < contours.Count(); i++)
  439. {
  440. OpenCvSharp.Point[] tempLine = contours[i];
  441. if (tempLine != null && tempLine.Length > 1)
  442. {
  443. List<OpenCvSharp.Point> pointsEdit = tempLine.ToList();
  444. for (int y = tempLine.Length - 1; y >= 0; y--)
  445. {
  446. if (rectangle.Contains(tempLine[y].X + contoursLeft, tempLine[y].Y + contoursTop))
  447. {
  448. pointsEdit.RemoveAt(y);
  449. }
  450. }
  451. contours[i] = pointsEdit.ToArray();
  452. }
  453. }
  454. }
  455. //p.mat = PreActionIntent.RectangleDelete(p.mat, rect);
  456. ////保存处理后的图片
  457. //Bitmap originalBit = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(this.documentWorkspace.PhaseModels[0].mat);
  458. //Bitmap newBit = originalBit.Clone(new Rectangle(0, 0, originalBit.Width, originalBit.Height), originalBit.PixelFormat);
  459. //Graphics graphics = Graphics.FromImage(newBit);
  460. //Draw(graphics);
  461. //this.documentWorkspace.PhaseModels[0].mat/* = phaseMat*/ = OpenCvSharp.Extensions.BitmapConverter.ToMat(newBit);
  462. this.rectangle.X = -1;
  463. this.rectangle.Y = -1;
  464. this.rectangle.Width = 0;
  465. this.rectangle.Height = 0;
  466. startPoint = new Point(-1, -1);
  467. endPoint = new Point(-1, -1);
  468. this.pointKtype = 0;
  469. this.documentWorkspace.Refresh();
  470. }
  471. // 折线添加/折线删除
  472. if (this.pointKtype == 1 || this.pointKtype == 11)
  473. {
  474. pointArray.Add(new Point((int)point1.X, (int)point1.Y));
  475. if (this.startPoint.X > -1 && this.startPoint.Y > -1)
  476. {
  477. }
  478. else
  479. startPoint = new Point((int)point1.X, (int)point1.Y);
  480. //// 折线删除
  481. //if (this.pointKtype == 11 && pointArray.Count >= 2)
  482. //{
  483. // Pen pen = new Pen(this.phaseColor, 1);
  484. // pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
  485. // g.DrawPolygon(pen, pointArray.ToArray());
  486. // pen.Dispose();
  487. //}
  488. //// 折线添加
  489. //if (this.pointKtype == 1 && pointArray.Count >= 2)
  490. //{
  491. // Pen pen = new Pen(this.phaseColor, 1);
  492. // g.DrawLines(pen, pointArray.ToArray());
  493. // pen.Dispose();
  494. //}
  495. //循环处理轮廓的点
  496. if (this.pointKtype == 11 && contours != null && contours.Length > 0 && pointArray.Count >= 2)
  497. {
  498. List<OpenCvSharp.Point> temp111Src = new List<OpenCvSharp.Point>();
  499. foreach (Point itemP in pointArray)
  500. {
  501. temp111Src.Add(new OpenCvSharp.Point(itemP.X, itemP.Y));
  502. }
  503. OpenCvSharp.Point[] temp11Line = temp111Src.ToArray();
  504. //循环处理轮廓的点
  505. for (int i = 0; i < contours.Count(); i++)
  506. {
  507. OpenCvSharp.Point[] tempLine = contours[i];
  508. if (tempLine != null && tempLine.Length > 1)
  509. {
  510. List<OpenCvSharp.Point> pointsEdit = tempLine.ToList();
  511. for (int y = tempLine.Length - 1; y >= 0; y--)
  512. {
  513. if (Cv2.PointPolygonTest(temp11Line, new Point2f(tempLine[y].X + contoursLeft, tempLine[y].Y + contoursTop), false) >= 0)
  514. {
  515. pointsEdit.RemoveAt(y);
  516. }
  517. }
  518. contours[i] = pointsEdit.ToArray();
  519. }
  520. }
  521. }
  522. //循环处理轮廓的点
  523. if (this.pointKtype == 1 && contours != null && contours.Length > 0 && pointArray.Count >= 2)
  524. {
  525. List<OpenCvSharp.Point[]> listContours = contours.ToList();
  526. List<OpenCvSharp.Point> pointsEdit = new List<OpenCvSharp.Point>();
  527. foreach (Point itemP in pointArray)
  528. {
  529. pointsEdit.Add(new OpenCvSharp.Point(itemP.X, itemP.Y));
  530. }
  531. listContours.Add(pointsEdit.ToArray());
  532. contours = listContours.ToArray();
  533. }
  534. this.documentWorkspace.Refresh();
  535. }
  536. // 直线添加
  537. if (this.pointKtype == 2 && this.startPoint.X > -1 && this.startPoint.Y > -1)
  538. {
  539. endPoint = new Point((int)point1.X, (int)point1.Y);
  540. //保存处理后的图片
  541. Bitmap originalBit = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(this.documentWorkspace.PhaseModels[0].mat);
  542. Bitmap newBit = originalBit.Clone(new Rectangle(0, 0, originalBit.Width, originalBit.Height), originalBit.PixelFormat);
  543. Graphics graphics = Graphics.FromImage(newBit);
  544. Draw(graphics);
  545. this.documentWorkspace.PhaseModels[0].mat/* = phaseMat*/ = OpenCvSharp.Extensions.BitmapConverter.ToMat(newBit);
  546. //// 折线删除
  547. //if (this.pointKtype == 11 && pointArray.Count >= 2)
  548. //{
  549. // Pen pen = new Pen(this.phaseColor, 1);
  550. // pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
  551. // g.DrawPolygon(pen, pointArray.ToArray());
  552. // pen.Dispose();
  553. //}
  554. //// 折线添加
  555. //if (this.pointKtype == 1 && pointArray.Count >= 2)
  556. //{
  557. // Pen pen = new Pen(this.phaseColor, 1);
  558. // g.DrawLines(pen, pointArray.ToArray());
  559. // pen.Dispose();
  560. //}
  561. //// 直线添加
  562. //if (this.pointKtype == 2 && this.startPoint.X > -1 && this.startPoint.Y > -1 )
  563. //{
  564. // Pen pen = new Pen(this.phaseColor, 1);
  565. // //pen.DashStyle = DashStyle.Dash;
  566. // g.DrawLine(pen, startPoint.X, startPoint.Y, endPoint.X, endPoint.Y);
  567. // pen.Dispose();
  568. //}
  569. //循环处理轮廓的点
  570. if (contours != null && contours.Length > 0 && this.endPoint.X > -1 && this.endPoint.Y > -1)
  571. {
  572. List<OpenCvSharp.Point[]> listContours = contours.ToList();
  573. List<OpenCvSharp.Point> pointsEdit = new List<OpenCvSharp.Point>();
  574. pointsEdit.Add(new OpenCvSharp.Point(this.startPoint.X, this.startPoint.Y));
  575. pointsEdit.Add(new OpenCvSharp.Point(this.endPoint.X, this.endPoint.Y));
  576. listContours.Add(pointsEdit.ToArray());
  577. contours = listContours.ToArray();
  578. }
  579. startPoint = new Point(-1, -1);
  580. endPoint = new Point(-1, -1);
  581. this.pointKtype = 0;
  582. this.documentWorkspace.Refresh();
  583. }
  584. }
  585. }
  586. #endregion
  587. /// <summary>
  588. /// surfaceBox双击事件
  589. /// 目前是参考AxioVision
  590. /// 应该是把每次选的点都取最高和最低的BGR
  591. /// </summary>
  592. /// <param name="sender"></param>
  593. /// <param name="e"></param>
  594. private unsafe void pictureBox1_Click(object sender, EventArgs e)
  595. {
  596. }
  597. /// <summary>
  598. /// 画布绘制
  599. /// </summary>
  600. /// <param name="sender"></param>
  601. /// <param name="e"></param>
  602. private void Panel_Paint(object sender, PaintEventArgs e)
  603. {
  604. if (this.documentWorkspace.CompositionSurface != null)
  605. {
  606. //
  607. // 以下是计算绘制图片的位置和大小并绘制图片
  608. //
  609. System.Drawing.Rectangle rc = this.documentWorkspace.panel.ClientRectangle;
  610. int width = (int)(this.documentWorkspace.CompositionSurface.Width * this.documentWorkspace.ScaleFactor.Ratio);
  611. int height = (int)(this.documentWorkspace.CompositionSurface.Height * this.documentWorkspace.ScaleFactor.Ratio);
  612. int x = (rc.Width < width) ? this.documentWorkspace.panel.AutoScrollPosition.X : (rc.Width - width) / 2;
  613. int y = (rc.Height < height) ? this.documentWorkspace.panel.AutoScrollPosition.Y : (rc.Height - height) / 2;
  614. //
  615. // 以下是绘制网格、标注、测量、视场等开始
  616. //
  617. e.Graphics.TranslateTransform(x, y);
  618. e.Graphics.ScaleTransform((float)this.documentWorkspace.ScaleFactor.Ratio, (float)this.documentWorkspace.ScaleFactor.Ratio);
  619. //if (this.checkBox4_0.Checked)//显示网格
  620. Draw(e.Graphics);
  621. e.Graphics.ScaleTransform(1 / (float)this.documentWorkspace.ScaleFactor.Ratio, 1 / (float)this.documentWorkspace.ScaleFactor.Ratio);
  622. e.Graphics.TranslateTransform(-x, -y);
  623. }
  624. }
  625. /// <summary>
  626. /// 绘制
  627. /// </summary>
  628. private void Draw(Graphics g/*graphics*/)
  629. {
  630. // 抗锯齿
  631. g.SmoothingMode = SmoothingMode.AntiAlias;
  632. if (guideClass != null && guideClass.GrainSizeGuideAreaMethodModel != null)
  633. guideClass.DrawAreaGuide(g, SelectedItem, guideClass.guideModel);
  634. else if (guideClass != null && guideClass.GrainSizeGuideStyleModel != null)
  635. guideClass.DrawGuideLines(g, SelectedItem, guideClass.guideModel);
  636. //圆形删除/椭圆删除
  637. if ((this.pointKtype == 14 || this.pointKtype == 12) && (this.rectangle.Width > 0 || this.rectangle.Height > 0))
  638. {
  639. Pen pen = new Pen(this.phaseColor, 1);
  640. pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
  641. if (this.pointKtype == 14)
  642. g.DrawEllipse(pen, this.rectangle);
  643. else
  644. g.DrawEllipse(pen, new RectangleF(this.rectangle.X, this.rectangle.Y, Math.Min(this.rectangle.Width, this.rectangle.Height), Math.Min(this.rectangle.Width, this.rectangle.Height)));
  645. pen.Dispose();
  646. }
  647. //矩形删除
  648. if (this.pointKtype == 13 && (this.rectangle.Width > 0 || this.rectangle.Height > 0))
  649. {
  650. Pen pen = new Pen(this.phaseColor, 1);
  651. pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
  652. g.DrawRectangle(pen, new Rectangle((int)this.rectangle.X, (int)this.rectangle.Y, (int)this.rectangle.Width, (int)this.rectangle.Height));
  653. pen.Dispose();
  654. }
  655. // 折线删除
  656. if (this.pointKtype == 11 && pointArray.Count >= 2)
  657. {
  658. Pen pen = new Pen(this.phaseColor, 1);
  659. pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
  660. g.DrawPolygon(pen, pointArray.ToArray());
  661. pen.Dispose();
  662. }
  663. //float penwidth = contoursWidth * this.documentWorkspace.panel.Width
  664. // 直线添加
  665. if (this.pointKtype == 2 && this.startPoint.X > -1 && this.startPoint.Y > -1 && this.endPoint.X > -1 && this.endPoint.Y > -1)
  666. {
  667. Pen pen = new Pen(this.phaseColor, contoursWidth/*1*/);
  668. //pen.DashStyle = DashStyle.Dash;
  669. g.DrawLine(pen, startPoint.X, startPoint.Y, endPoint.X, endPoint.Y);
  670. pen.Dispose();
  671. }
  672. // 折线添加
  673. if (this.pointKtype == 1 && pointArray.Count >= 2)
  674. {
  675. Pen pen = new Pen(this.phaseColor, contoursWidth/*1*/);
  676. g.DrawLines(pen, pointArray.ToArray());
  677. pen.Dispose();
  678. }
  679. }
  680. private void InitializeLanguageText()
  681. {
  682. this.groupBox1.Text = PdnResources.GetString("Menu.operation.text");
  683. this.button9.Text = PdnResources.GetString("CommonAction.Undo");
  684. this.button2.Text = PdnResources.GetString("Menu.File.Close.Text");
  685. this.button1.Text = PdnResources.GetString("Form.OkButton.Text");
  686. this.groupBox2.Text = PdnResources.GetString("Menu.Addtheoutline.Text");
  687. this.button4.Text = PdnResources.GetString("Menu.Lineadd.text");
  688. this.button3.Text = PdnResources.GetString("Menu.Polylineadd.text");
  689. this.groupBox3.Text = PdnResources.GetString("Menu.Deletetheprofil.Text");
  690. this.button8.Text = PdnResources.GetString("Menu.Ellipsedelete.text");
  691. this.button7.Text = PdnResources.GetString("Menu.BinaryAction.RectangleDelete.Text");
  692. this.button6.Text = PdnResources.GetString("Menu.rounddelete.text");
  693. this.button5.Text = PdnResources.GetString("Menu.BinaryAction.PolygonleDelete.Text");
  694. this.groupBox7.Text = PdnResources.GetString("Menu.Preview.text");
  695. this.Text = PdnResources.GetString("Menu.Outlineoftheeditor.Text");
  696. }
  697. private void InitializeComponent()
  698. {
  699. this.groupBox1 = new System.Windows.Forms.GroupBox();
  700. this.button9 = new System.Windows.Forms.Button();
  701. this.button2 = new System.Windows.Forms.Button();
  702. this.button1 = new System.Windows.Forms.Button();
  703. this.groupBox2 = new System.Windows.Forms.GroupBox();
  704. this.button4 = new System.Windows.Forms.Button();
  705. this.button3 = new System.Windows.Forms.Button();
  706. this.groupBox3 = new System.Windows.Forms.GroupBox();
  707. this.button8 = new System.Windows.Forms.Button();
  708. this.button7 = new System.Windows.Forms.Button();
  709. this.button6 = new System.Windows.Forms.Button();
  710. this.button5 = new System.Windows.Forms.Button();
  711. this.groupBox7 = new System.Windows.Forms.GroupBox();
  712. this.groupBox1.SuspendLayout();
  713. this.groupBox2.SuspendLayout();
  714. this.groupBox3.SuspendLayout();
  715. this.SuspendLayout();
  716. //
  717. // groupBox1
  718. //
  719. this.groupBox1.Controls.Add(this.button9);
  720. this.groupBox1.Controls.Add(this.button2);
  721. this.groupBox1.Controls.Add(this.button1);
  722. this.groupBox1.Location = new System.Drawing.Point(12, 12);
  723. this.groupBox1.Name = "groupBox1";
  724. this.groupBox1.Size = new System.Drawing.Size(808, 45);
  725. this.groupBox1.TabIndex = 0;
  726. this.groupBox1.TabStop = false;
  727. //
  728. // button9
  729. //
  730. this.button9.Location = new System.Drawing.Point(468, 13);
  731. this.button9.Name = "button9";
  732. this.button9.Size = new System.Drawing.Size(91, 26);
  733. this.button9.TabIndex = 2;
  734. this.button9.UseVisualStyleBackColor = true;
  735. this.button9.Visible = false;
  736. this.button9.Click += new System.EventHandler(this.button9_Click);
  737. //
  738. // button2
  739. //
  740. this.button2.Location = new System.Drawing.Point(694, 13);
  741. this.button2.Name = "button2";
  742. this.button2.Size = new System.Drawing.Size(91, 26);
  743. this.button2.TabIndex = 1;
  744. this.button2.UseVisualStyleBackColor = true;
  745. this.button2.Click += new System.EventHandler(this.button2_Click);
  746. //
  747. // button1
  748. //
  749. this.button1.Location = new System.Drawing.Point(582, 13);
  750. this.button1.Name = "button1";
  751. this.button1.Size = new System.Drawing.Size(91, 26);
  752. this.button1.TabIndex = 0;
  753. this.button1.UseVisualStyleBackColor = true;
  754. this.button1.Click += new System.EventHandler(this.button1_Click);
  755. //
  756. // groupBox2
  757. //
  758. this.groupBox2.Controls.Add(this.button4);
  759. this.groupBox2.Controls.Add(this.button3);
  760. this.groupBox2.Location = new System.Drawing.Point(12, 63);
  761. this.groupBox2.Name = "groupBox2";
  762. this.groupBox2.Size = new System.Drawing.Size(233, 106);
  763. this.groupBox2.TabIndex = 1;
  764. this.groupBox2.TabStop = false;
  765. //
  766. // button4
  767. //
  768. this.button4.Location = new System.Drawing.Point(135, 31);
  769. this.button4.Name = "button4";
  770. this.button4.Size = new System.Drawing.Size(73, 26);
  771. this.button4.TabIndex = 3;
  772. this.button4.UseVisualStyleBackColor = true;
  773. this.button4.Click += new System.EventHandler(this.button4_Click);
  774. //
  775. // button3
  776. //
  777. this.button3.Location = new System.Drawing.Point(28, 31);
  778. this.button3.Name = "button3";
  779. this.button3.Size = new System.Drawing.Size(73, 26);
  780. this.button3.TabIndex = 2;
  781. this.button3.UseVisualStyleBackColor = true;
  782. this.button3.Click += new System.EventHandler(this.button3_Click);
  783. //
  784. // groupBox3
  785. //
  786. this.groupBox3.Controls.Add(this.button8);
  787. this.groupBox3.Controls.Add(this.button7);
  788. this.groupBox3.Controls.Add(this.button6);
  789. this.groupBox3.Controls.Add(this.button5);
  790. this.groupBox3.Location = new System.Drawing.Point(12, 175);
  791. this.groupBox3.Name = "groupBox3";
  792. this.groupBox3.Size = new System.Drawing.Size(233, 106);
  793. this.groupBox3.TabIndex = 1;
  794. this.groupBox3.TabStop = false;
  795. //
  796. // button8
  797. //
  798. this.button8.Location = new System.Drawing.Point(135, 68);
  799. this.button8.Name = "button8";
  800. this.button8.Size = new System.Drawing.Size(73, 26);
  801. this.button8.TabIndex = 7;
  802. this.button8.UseVisualStyleBackColor = true;
  803. this.button8.Click += new System.EventHandler(this.button8_Click);
  804. //
  805. // button7
  806. //
  807. this.button7.Location = new System.Drawing.Point(28, 68);
  808. this.button7.Name = "button7";
  809. this.button7.Size = new System.Drawing.Size(73, 26);
  810. this.button7.TabIndex = 6;
  811. this.button7.UseVisualStyleBackColor = true;
  812. this.button7.Click += new System.EventHandler(this.button7_Click);
  813. //
  814. // button6
  815. //
  816. this.button6.Location = new System.Drawing.Point(135, 24);
  817. this.button6.Name = "button6";
  818. this.button6.Size = new System.Drawing.Size(73, 26);
  819. this.button6.TabIndex = 5;
  820. this.button6.UseVisualStyleBackColor = true;
  821. this.button6.Click += new System.EventHandler(this.button6_Click);
  822. //
  823. // button5
  824. //
  825. this.button5.Location = new System.Drawing.Point(28, 24);
  826. this.button5.Name = "button5";
  827. this.button5.Size = new System.Drawing.Size(73, 26);
  828. this.button5.TabIndex = 4;
  829. this.button5.UseVisualStyleBackColor = true;
  830. this.button5.Click += new System.EventHandler(this.button5_Click);
  831. //
  832. // groupBox7
  833. //
  834. this.groupBox7.Location = new System.Drawing.Point(251, 63);
  835. this.groupBox7.Name = "groupBox7";
  836. this.groupBox7.Size = new System.Drawing.Size(569, 502);
  837. this.groupBox7.TabIndex = 1;
  838. this.groupBox7.TabStop = false;
  839. //
  840. // GrainContoursEditingDialog
  841. //
  842. this.ClientSize = new System.Drawing.Size(832, 577);
  843. this.Controls.Add(this.groupBox2);
  844. this.Controls.Add(this.groupBox3);
  845. this.Controls.Add(this.groupBox7);
  846. this.Controls.Add(this.groupBox1);
  847. this.MaximizeBox = false;
  848. this.MinimizeBox = false;
  849. this.Name = "GrainContoursEditingDialog";
  850. this.groupBox1.ResumeLayout(false);
  851. this.groupBox2.ResumeLayout(false);
  852. this.groupBox3.ResumeLayout(false);
  853. this.ResumeLayout(false);
  854. }
  855. /// <summary>
  856. /// 折线添加
  857. /// </summary>
  858. /// <param name="sender"></param>
  859. /// <param name="e"></param>
  860. private void button3_Click(object sender, EventArgs e)
  861. {
  862. pointArray.Clear();
  863. startPoint = new Point(-1, -1);
  864. endPoint = new Point(-1, -1);
  865. pointKtype = 1;
  866. this.documentWorkspace.Refresh();
  867. }
  868. /// <summary>
  869. /// 直线添加
  870. /// </summary>
  871. /// <param name="sender"></param>
  872. /// <param name="e"></param>
  873. private void button4_Click(object sender, EventArgs e)
  874. {
  875. startPoint = new Point(-1, -1);
  876. endPoint = new Point(-1, -1);
  877. pointKtype = 2;
  878. this.documentWorkspace.Refresh();
  879. }
  880. private void InitCommonButtonEvent()
  881. {
  882. this.commonControlButtons.zoomInButton.Click += new EventHandler(zoomInButton_Click);
  883. this.commonControlButtons.zoomOutButton.Click += new EventHandler(zoomOutButton_Click);
  884. this.commonControlButtons.zoomToWindowButton.Click += new EventHandler(zoomToWindowButton_Click);
  885. this.commonControlButtons.actualSizeButton.Click += new EventHandler(actualSizeButton_Click);
  886. this.commonControlButtons.pointerButton.Click += new EventHandler(pointerButton_Click);
  887. this.commonControlButtons.mobileModeButton.Click += new EventHandler(mobileModeButton_Click);
  888. }
  889. private void zoomInButton_Click(object sender, EventArgs e)
  890. {
  891. this.documentWorkspace.ZoomIn();
  892. }
  893. private void zoomOutButton_Click(object sender, EventArgs e)
  894. {
  895. this.documentWorkspace.ZoomOut();
  896. }
  897. private void zoomToWindowButton_Click(object sender, EventArgs e)
  898. {
  899. this.documentWorkspace.ZoomBasis = ZoomBasis.FitToWindow;
  900. }
  901. private void actualSizeButton_Click(object sender, EventArgs e)
  902. {
  903. this.documentWorkspace.ZoomBasis = ZoomBasis.ScaleFactor;
  904. this.documentWorkspace.ScaleFactor = ScaleFactor.OneToOne;
  905. }
  906. private void pointerButton_Click(object sender, EventArgs e)
  907. {
  908. this.documentWorkspace.ActiveTool = Annotation.Enum.DrawToolType.Pointer;
  909. }
  910. private void mobileModeButton_Click(object sender, EventArgs e)
  911. {
  912. this.documentWorkspace.ActiveTool = Annotation.Enum.DrawToolType.MoveMode;
  913. }
  914. //确定按钮点击事件
  915. private void button1_Click(object sender, EventArgs e)
  916. {
  917. this.PhaseMat = this.documentWorkspace.PhaseModels[0].mat;
  918. //Cv2.ImShow("dst", this.documentWorkspace.PhaseModels[0].mat);
  919. this.DialogResult = DialogResult.OK;
  920. this.Close();
  921. }
  922. /// <summary>
  923. /// 用于get处理后的图像
  924. /// </summary>
  925. public Mat PhaseMat
  926. {
  927. get
  928. {
  929. return this.phaseMat;
  930. }
  931. set
  932. {
  933. this.phaseMat = value;
  934. }
  935. }
  936. /// <summary>
  937. /// 用于get处理后的图像
  938. /// </summary>
  939. public OpenCvSharp.Point[][] PhaseContours
  940. {
  941. get
  942. {
  943. return this.contours.ToList().ToArray();
  944. }
  945. }
  946. /// <summary>
  947. /// 矩形删除
  948. /// </summary>
  949. /// <param name="sender"></param>
  950. /// <param name="e"></param>
  951. private void button7_Click(object sender, EventArgs e)
  952. {
  953. startPoint = new Point(-1, -1);
  954. endPoint = new Point(-1, -1);
  955. this.rectangle.X = -1;
  956. this.rectangle.Y = -1;
  957. this.rectangle.Width = 0;
  958. this.rectangle.Height = 0;
  959. this.pointKtype = 13;
  960. this.documentWorkspace.Refresh();
  961. }
  962. /// <summary>
  963. /// 椭圆删除
  964. /// </summary>
  965. /// <param name="sender"></param>
  966. /// <param name="e"></param>
  967. private void button8_Click(object sender, EventArgs e)
  968. {
  969. startPoint = new Point(-1, -1);
  970. endPoint = new Point(-1, -1);
  971. this.rectangle.X = -1;
  972. this.rectangle.Y = -1;
  973. this.rectangle.Width = 0;
  974. this.rectangle.Height = 0;
  975. this.pointKtype = 14;
  976. this.documentWorkspace.Refresh();
  977. }
  978. /// <summary>
  979. /// 圆形删除
  980. /// </summary>
  981. /// <param name="sender"></param>
  982. /// <param name="e"></param>
  983. private void button6_Click(object sender, EventArgs e)
  984. {
  985. startPoint = new Point(-1, -1);
  986. endPoint = new Point(-1, -1);
  987. this.rectangle.X = -1;
  988. this.rectangle.Y = -1;
  989. this.rectangle.Width = 0;
  990. this.rectangle.Height = 0;
  991. this.pointKtype = 12;
  992. this.documentWorkspace.Refresh();
  993. }
  994. /// <summary>
  995. /// 多边形删除
  996. /// </summary>
  997. /// <param name="sender"></param>
  998. /// <param name="e"></param>
  999. private void button5_Click(object sender, EventArgs e)
  1000. {
  1001. pointArray.Clear();
  1002. startPoint = new Point(-1, -1);
  1003. endPoint = new Point(-1, -1);
  1004. this.rectangle.X = -1;
  1005. this.rectangle.Y = -1;
  1006. this.rectangle.Width = 0;
  1007. this.rectangle.Height = 0;
  1008. this.pointKtype = 11;
  1009. this.documentWorkspace.Refresh();
  1010. }
  1011. private void button2_Click(object sender, EventArgs e)
  1012. {
  1013. this.Close();
  1014. }
  1015. /// <summary>
  1016. /// 撤销按钮点击事件
  1017. /// </summary>
  1018. /// <param name="sender"></param>
  1019. /// <param name="e"></param>
  1020. private void button9_Click(object sender, EventArgs e)
  1021. {
  1022. }
  1023. }
  1024. }