CDisplayGDIObject.cs 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Drawing;
  4. using System.Drawing.Drawing2D;
  5. using System.Net;
  6. using System.Numerics;
  7. using System.Windows.Forms;
  8. namespace OTSMeasureApp
  9. {
  10. public class CDisplayGDIObject
  11. {
  12. public CDisplayGDIObject()
  13. {
  14. ID = System.Guid.NewGuid().ToString();
  15. OTSX = -1;
  16. OTSY = -1;
  17. }
  18. /// <summary>
  19. /// 创建图形
  20. /// </summary>
  21. /// <param name="startx">X位置</param>
  22. /// <param name="starty">Y位置</param>
  23. /// <param name="width">宽度</param>
  24. /// <param name="height">高度</param>
  25. /// <param name="cType">图形类型:createType=0 圆角矩形 createType=1 圆形 createType=2 文字</param>
  26. /// <param name="content">文字内容</param>
  27. public CDisplayGDIObject(float startx, float starty, float width, float height, CreateRectangleType cType, string content, string name)
  28. {
  29. var rec = new RectangleF(startx, starty, width, height);
  30. m_OrigineRegionF = rec;
  31. SetInitRegionF(m_OrigineRegionF);
  32. CreateType = cType;
  33. strContent = content;
  34. NameOrHoleName = name;
  35. ID = System.Guid.NewGuid().ToString();
  36. OTSX = -1;
  37. OTSY = -1;
  38. }
  39. public CDisplayGDIObject(RectangleF rect, CreateRectangleType cType)
  40. {
  41. m_OrigineRegionF = rect;
  42. SetInitRegionF(m_OrigineRegionF);
  43. CreateType = cType;
  44. ID = System.Guid.NewGuid().ToString();
  45. OTSX = -1;
  46. OTSY = -1;
  47. }
  48. public CDisplayGDIObject(RectangleF rect, CreateRectangleType cType, string name)
  49. {
  50. m_OrigineRegionF = rect;
  51. SetInitRegionF(m_OrigineRegionF);
  52. CreateType = cType;
  53. NameOrHoleName = name;
  54. ID = System.Guid.NewGuid().ToString();
  55. OTSX = -1;
  56. OTSY = -1;
  57. }
  58. public CDisplayGDIObject(RectangleF rect, CreateRectangleType cType, ShapeType shape, string name, Color selColor)
  59. {
  60. m_OrigineRegionF = rect;
  61. SetInitRegionF(m_OrigineRegionF);
  62. CreateType = cType;
  63. NameOrHoleName = name;
  64. Shape = shape;
  65. SelColor = selColor;
  66. ID = System.Guid.NewGuid().ToString();
  67. OTSX = -1;
  68. OTSY = -1;
  69. }
  70. public CDisplayGDIObject(RectangleF rectMeasure, CreateRectangleType cType, ShapeType shape, string name, string sampleName, Color selColor)
  71. {
  72. m_OrigineRegionF = rectMeasure;
  73. SetInitRegionF(m_OrigineRegionF);
  74. CreateType = cType;
  75. NameOrHoleName = name;
  76. Shape = shape;
  77. SelColor = selColor;
  78. SampleName = sampleName;
  79. ID = System.Guid.NewGuid().ToString();
  80. OTSX = -1;
  81. OTSY = -1;
  82. }
  83. //绘制帧图
  84. public CDisplayGDIObject(RectangleF rectSingle, CreateRectangleType cType, string name, string sampleName, Color selColor)
  85. {
  86. m_OrigineRegionF = rectSingle;
  87. SetInitRegionF(m_OrigineRegionF);
  88. CreateType = cType;
  89. NameOrHoleName = name;
  90. Shape = 0;
  91. SelColor = selColor;
  92. SampleName = sampleName;
  93. ID = System.Guid.NewGuid().ToString();
  94. OTSX = -1;
  95. OTSY = -1;
  96. }
  97. //绘制帧图
  98. public CDisplayGDIObject(RectangleF rectField, int OTSx, int OTSy, CreateRectangleType cType, string name, string sampleName, Color selColor)
  99. {
  100. m_OrigineRegionF = rectField;
  101. SetInitRegionF(m_OrigineRegionF);
  102. CreateType = cType;
  103. NameOrHoleName = name;
  104. Shape = 0;
  105. SelColor = selColor;
  106. SampleName = sampleName;
  107. ID = System.Guid.NewGuid().ToString();
  108. OTSX = OTSx;
  109. OTSY = OTSy;
  110. }
  111. /// <summary>
  112. /// 获取样品孔中BSE图像
  113. /// </summary>
  114. /// <param name="rect">位置大小</param>
  115. /// <param name="sampleHoleName">所在样品孔名称</param>
  116. /// <param name="bseImage">图像信息</param>
  117. /// <param name="bseImageWitdh">图像宽度</param>
  118. /// <param name="bseImageHeight">图像高度</param>
  119. /// <param name="drawImageLocation">图像开始位置</param>
  120. /// <param name="cType">绘制类型</param>
  121. public CDisplayGDIObject(RectangleF rect, int OTSx, int OTSy, string sampleName, string sampleHoleName, float bseImageWitdh, float bseImageHeight, CreateRectangleType cType)
  122. {
  123. m_OrigineRegionF = rect;
  124. SetInitRegionF(m_OrigineRegionF);
  125. NameOrHoleName = sampleHoleName;
  126. SampleName = sampleName;
  127. //生成编号
  128. ID = System.Guid.NewGuid().ToString();
  129. //图像信息
  130. //BSEImage = bseImage;
  131. //图像宽度
  132. BSEImageWitdh = bseImageWitdh;
  133. //图像高度
  134. BSEImageHeight = bseImageHeight;
  135. //图像位置
  136. BSEImageLocation = rect.Location;
  137. OTSX = OTSx;
  138. OTSY = OTSy;
  139. //绘制类型
  140. CreateType = cType;
  141. }
  142. public CDisplayGDIObject(RectangleF rect, Point ImgPoint, float m_Multiple, CreateRectangleType cType)
  143. {
  144. m_OrigineRegionF = rect;
  145. SetInitRegionF(m_OrigineRegionF);
  146. CreateType = cType;
  147. ID = System.Guid.NewGuid().ToString();
  148. OTSX = -1;
  149. OTSY = -1;
  150. }
  151. /// <summary>
  152. /// 获取多边形点集合
  153. /// </summary>
  154. /// <param name="mPoint"></param>
  155. /// <param name="cType"></param>
  156. public CDisplayGDIObject(List<PointF> mPoint, CreateRectangleType cType, ShapeType shape, string name, string sampleName, Color selColor)
  157. {
  158. ID = System.Guid.NewGuid().ToString();
  159. this.SetOriginalPolygonPointFList(mPoint);
  160. CreateType = cType;
  161. Shape = shape;
  162. SelColor = selColor;
  163. }
  164. #region 变量重写
  165. public virtual void OnPaint(PaintEventArgs e)
  166. {
  167. if (createType == CreateRectangleType.SampleBackGround_Rectangle)
  168. {
  169. //获取颜色
  170. Color myColor = OTSSamplespaceGraphicsPanelFun.GetColorValue(ColorType.RoundRectangleColor);
  171. System.Drawing.SolidBrush sampleBrush = new System.Drawing.SolidBrush(myColor);
  172. GraphicsPath grPath = CreateRoundedRectanglePath(m_RegionF, 20);
  173. //e.Graphics.SmoothingMode = SmoothingMode.HighQuality;
  174. e.Graphics.FillPath(sampleBrush, grPath);
  175. e.Graphics.DrawPath(Pens.Black, grPath);
  176. }
  177. //样品台-圆形
  178. else if (createType == CreateRectangleType.SampleBackGround_Circle)
  179. {
  180. //获取颜色
  181. Color myColor = OTSSamplespaceGraphicsPanelFun.GetColorValue(ColorType.SampleBackGroundColor);
  182. System.Drawing.SolidBrush sampleBrush = new System.Drawing.SolidBrush(myColor);
  183. e.Graphics.SmoothingMode = SmoothingMode.AntiAlias; //图片柔顺模式选择
  184. e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;//高质量
  185. e.Graphics.CompositingQuality = CompositingQuality.HighQuality;//再加一点
  186. e.Graphics.FillEllipse(sampleBrush, m_RegionF);
  187. e.Graphics.DrawEllipse(Pens.Black, m_RegionF);
  188. }
  189. //圆形
  190. else if (createType == CreateRectangleType.Circle)
  191. {
  192. System.Drawing.SolidBrush sampleBrush = new System.Drawing.SolidBrush(System.Drawing.Color.White);
  193. e.Graphics.SmoothingMode = SmoothingMode.AntiAlias; //图片柔顺模式选择
  194. e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;//高质量
  195. e.Graphics.CompositingQuality = CompositingQuality.HighQuality;//再加一点
  196. e.Graphics.FillEllipse(sampleBrush, m_RegionF);
  197. e.Graphics.DrawEllipse(Pens.Black, m_RegionF);
  198. }
  199. //文字
  200. else if (createType == CreateRectangleType.Text)
  201. {
  202. //设置文字对齐方式
  203. StringFormat sf = new StringFormat();
  204. sf.Alignment = StringAlignment.Center;
  205. sf.LineAlignment = StringAlignment.Center;
  206. //文字颜色
  207. Color myColor = OTSSamplespaceGraphicsPanelFun.GetColorValue(ColorType.FontColor);
  208. System.Drawing.SolidBrush sampleBrush = new System.Drawing.SolidBrush(myColor);
  209. SolidBrush solidBrush = new SolidBrush(Color.FromArgb(50, Color.Black));
  210. //字体大小 根据样品孔Rectangle大小
  211. float fontSize = m_RegionF.Width / 2;
  212. Font font = new Font("宋体", fontSize, FontStyle.Regular);
  213. if (fontSize == 0)
  214. {
  215. font = new Font("宋体", 5, FontStyle.Regular);
  216. }
  217. //消除锯齿
  218. e.Graphics.SmoothingMode = SmoothingMode.AntiAlias; //图片柔顺模式选择
  219. e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;//高质量
  220. e.Graphics.CompositingQuality = CompositingQuality.HighQuality;//再加一点
  221. e.Graphics.DrawString(strContent, font, sampleBrush, m_RegionF, sf);
  222. }
  223. //矩形
  224. else if (createType == CreateRectangleType.Rectangle)
  225. {
  226. Color myColor = System.Drawing.Color.White;
  227. System.Drawing.SolidBrush sampleBrush = new System.Drawing.SolidBrush(myColor);
  228. e.Graphics.SmoothingMode = SmoothingMode.AntiAlias; //图片柔顺模式选择
  229. e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;//高质量
  230. e.Graphics.CompositingQuality = CompositingQuality.HighQuality;//再加一点
  231. e.Graphics.FillRectangle(sampleBrush, m_RegionF);
  232. var m_Region = new Rectangle();
  233. m_Region.X = (int)m_RegionF.X;
  234. m_Region.Y = (int)m_RegionF.Y;
  235. m_Region.Width = (int)m_RegionF.Width;
  236. m_Region.Height = (int)m_RegionF.Height;
  237. e.Graphics.DrawRectangle(Pens.Black, m_Region);
  238. }
  239. //选择样品台
  240. else if (createType == CreateRectangleType.SelectSample)
  241. {
  242. Color myColor = selColor;
  243. System.Drawing.SolidBrush sampleBrush = new System.Drawing.SolidBrush(myColor);
  244. if (Shape == 0)
  245. {
  246. e.Graphics.FillEllipse(sampleBrush, m_RegionF);
  247. e.Graphics.DrawEllipse(Pens.Black, m_RegionF);
  248. }
  249. else
  250. {
  251. e.Graphics.FillRectangle(sampleBrush, m_RegionF);
  252. var m_Region = new Rectangle();
  253. m_Region.X = (int)m_RegionF.X;
  254. m_Region.Y = (int)m_RegionF.Y;
  255. m_Region.Width = (int)m_RegionF.Width;
  256. m_Region.Height = (int)m_RegionF.Height;
  257. e.Graphics.DrawRectangle(Pens.Black, m_Region);
  258. }
  259. }
  260. //测试区域
  261. else if (createType == CreateRectangleType.MeasureArea)
  262. {
  263. Color myColor = selColor;
  264. System.Drawing.SolidBrush sampleBrush = new System.Drawing.SolidBrush(myColor);
  265. Pen p = new Pen(myColor, 1);
  266. e.Graphics.SmoothingMode = SmoothingMode.AntiAlias; //图片柔顺模式选择
  267. e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;//高质量
  268. e.Graphics.CompositingQuality = CompositingQuality.HighQuality;//再加一点
  269. if (Shape == 0)
  270. {
  271. e.Graphics.DrawEllipse(p, m_RegionF);
  272. }
  273. else
  274. {
  275. var m_Region = new Rectangle();
  276. m_Region.X = (int)m_RegionF.X;
  277. m_Region.Y = (int)m_RegionF.Y;
  278. m_Region.Width = (int)m_RegionF.Width;
  279. m_Region.Height = (int)m_RegionF.Height;
  280. e.Graphics.DrawRectangle(p, m_Region);
  281. }
  282. }
  283. //绘制帧图 直线
  284. else if (createType == CreateRectangleType.SingleLine)
  285. {
  286. //设置颜色
  287. Color myColor = OTSSamplespaceGraphicsPanelFun.GetColorValue(ColorType.FieldColor);
  288. //设置画笔
  289. System.Drawing.SolidBrush sampleBrush = new System.Drawing.SolidBrush(myColor);
  290. Pen pen = new Pen(sampleBrush, 0.0001f);
  291. //未抗锯齿
  292. e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.Default;
  293. e.Graphics.InterpolationMode = InterpolationMode.Default;
  294. e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
  295. //设置直线位置与尺寸
  296. PointF startPointF = new PointF(startPoint.X, startPoint.Y);
  297. PointF endPointF = new PointF(endPoint.X, endPoint.Y);
  298. //度量单位
  299. e.Graphics.PageUnit = GraphicsUnit.Display;
  300. e.Graphics.DrawLine(pen, startPointF, endPointF);
  301. }
  302. //绘制标样
  303. else if (createType == CreateRectangleType.SpecimenRectangle)
  304. {
  305. Color myColor = System.Drawing.Color.Black;
  306. System.Drawing.SolidBrush sampleBrush = new System.Drawing.SolidBrush(myColor);
  307. Pen pen = new Pen(sampleBrush, 0.0001f);
  308. e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
  309. var m_Region = new Rectangle();
  310. m_Region.X = (int)m_RegionF.X;
  311. m_Region.Y = (int)m_RegionF.Y;
  312. m_Region.Width = (int)m_RegionF.Width;
  313. m_Region.Height = (int)m_RegionF.Height;
  314. e.Graphics.DrawRectangle(pen, m_Region);
  315. e.Graphics.FillRectangle(sampleBrush, m_Region);
  316. }
  317. //绘制标样
  318. else if (createType == CreateRectangleType.SpecimenCircle)
  319. {
  320. Color myColor = System.Drawing.Color.Black;
  321. System.Drawing.SolidBrush sampleBrush = new System.Drawing.SolidBrush(myColor);
  322. Pen pen = new Pen(sampleBrush, 0.0001f);
  323. e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
  324. e.Graphics.DrawEllipse(pen, m_RegionF);
  325. e.Graphics.FillEllipse(sampleBrush, m_RegionF);
  326. }
  327. //绘制帧图
  328. else if (createType == CreateRectangleType.FieldRectangle)
  329. {
  330. Color myColor = SelColor;
  331. System.Drawing.SolidBrush sampleBrush = new System.Drawing.SolidBrush(myColor);
  332. Pen pen = new Pen(sampleBrush, 0.01f);
  333. e.Graphics.SmoothingMode = SmoothingMode.Default;
  334. //设置直线位置与尺寸
  335. PointF startPointF = new PointF(m_RegionF.Left, m_RegionF.Top);
  336. PointF endPointF = new PointF(m_RegionF.Right, m_RegionF.Bottom);
  337. if (m_RegionF.Height > 20)//won't display when it's too small,to speed up
  338. {
  339. float fontSize = m_RegionF.Width / 4;
  340. Font font;
  341. if (fontSize == 0)
  342. {
  343. font = new Font("宋体", 5, FontStyle.Regular);
  344. }
  345. else
  346. {
  347. font = new Font("宋体", fontSize, FontStyle.Regular);
  348. }
  349. StringFormat sf = new StringFormat();
  350. sf.Alignment = StringAlignment.Center;
  351. sf.LineAlignment = StringAlignment.Center;
  352. e.Graphics.DrawString(m_sequenceNum.ToString(), font, sampleBrush, m_RegionF, sf);
  353. }
  354. //绘制帧图
  355. e.Graphics.DrawRectangle(pen, startPointF.X, startPointF.Y, endPointF.X - startPointF.X, endPointF.Y - startPointF.Y);
  356. }
  357. //绘制颗粒
  358. else if (createType == CreateRectangleType.ParticleLine)
  359. {
  360. Color myColor = LineColor;
  361. System.Drawing.SolidBrush sampleBrush = new System.Drawing.SolidBrush(myColor);
  362. Pen pen = new Pen(sampleBrush, 0.01f);
  363. e.Graphics.SmoothingMode = SmoothingMode.Default;
  364. //设置直线位置与长度
  365. PointF startPointF = LineStartPoint;
  366. float length = LineLength;
  367. PointF endPointF = new PointF(startPointF.X + length, startPointF.Y);
  368. e.Graphics.DrawLine(pen, startPointF, endPointF);
  369. }
  370. //矩形
  371. else if (createType == CreateRectangleType.ParticleAreaRectangle)
  372. {
  373. Color myColor = System.Drawing.Color.White;
  374. System.Drawing.SolidBrush sampleBrush = new System.Drawing.SolidBrush(myColor);
  375. var m_Region = new Rectangle();
  376. m_Region.X = (int)m_RegionF.X;
  377. m_Region.Y = (int)m_RegionF.Y;
  378. m_Region.Width = (int)m_RegionF.Width;
  379. m_Region.Height = (int)m_RegionF.Height;
  380. e.Graphics.DrawRectangle(Pens.Black, m_Region);
  381. }
  382. //绘制样品孔BSE图像
  383. else if (createType == CreateRectangleType.DrawFrameOfHoleBSEImage)
  384. {
  385. PointF startPointF = new PointF(m_RegionF.Left, m_RegionF.Top);
  386. PointF endPointF = new PointF(m_RegionF.Right + 2, m_RegionF.Bottom + 2);
  387. //绘制样品孔中图像信息
  388. if (BSEImage != null)
  389. {
  390. Image thumbnail = BSEImage.GetThumbnailImage((int)m_RegionF.Width + 2,(int)m_RegionF.Height + 2, null, IntPtr.Zero);
  391. e.Graphics.DrawImage(thumbnail, startPointF);/*, startPointF.X, startPointF.Y, endPointF.X - startPointF.X, endPointF.Y - startPointF.Y*/
  392. }
  393. }
  394. else if (createType == CreateRectangleType.DrawSEMCenterPoint)
  395. {
  396. Color myColor = System.Drawing.Color.Red;
  397. System.Drawing.SolidBrush sampleBrush = new System.Drawing.SolidBrush(myColor);
  398. //X轴线
  399. PointF startPointX = semCenterPoint;
  400. startPointX.X = startPointX.X - 3;
  401. PointF endPointX = semCenterPoint;
  402. endPointX.X = endPointX.X + 3;
  403. //Y轴线
  404. PointF startPointY = semCenterPoint;
  405. startPointY.Y = startPointY.Y - 3;
  406. PointF endPointY = semCenterPoint;
  407. endPointY.Y = endPointY.Y + 3;
  408. //绘制XY轴交叉线+
  409. Pen pen = new Pen(sampleBrush, 0.0001f);
  410. e.Graphics.DrawLine(pen, startPointX, endPointX);
  411. e.Graphics.DrawLine(pen, startPointY, endPointY);
  412. }
  413. //绘制BSE标记
  414. else if (createType == CreateRectangleType.DrawBSEElementSignPoint)
  415. {
  416. System.Drawing.SolidBrush sampleBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Green);
  417. Pen pen = new Pen(sampleBrush, 2f);
  418. int X = (int)m_OrigineRegionF.X;
  419. int Y = (int)m_OrigineRegionF.Y;
  420. e.Graphics.DrawLine(pen, new Point(X - 8, Y), new Point(X + 8, Y));
  421. e.Graphics.DrawLine(pen, new Point(X, Y - 8), new Point(X, Y + 8));
  422. }
  423. //绘制多边形测量区域
  424. else if (createType == CreateRectangleType.Polygon)
  425. {
  426. Color myColor = selColor;
  427. //System.Drawing.SolidBrush sampleBrush = new System.Drawing.SolidBrush(myColor);
  428. Pen pen = new Pen(myColor, 1);
  429. if (GetPolygonPointFList().Count > 0)
  430. {
  431. List<PointF> PolygonPointF = new List<PointF>();
  432. foreach (var item in m_PolygonPoints)
  433. {
  434. PolygonPointF.Add(item);
  435. }
  436. if (PolygonDrawingEndPoint.X != 0 && PolygonDrawingEndPoint.Y != 0)
  437. {
  438. PolygonPointF.Add(PolygonDrawingEndPoint);
  439. }
  440. e.Graphics.DrawLines(pen, PolygonPointF.ToArray());
  441. }
  442. }//多边形测量区域完成标识
  443. else if (createType == CreateRectangleType.DrawPolygonFinish)
  444. {
  445. Color myColor = selColor;
  446. Pen pen = new Pen(myColor, 1);
  447. var m_Region = new Rectangle();
  448. m_Region.X = (int)m_RegionF.X;
  449. m_Region.Y = (int)m_RegionF.Y;
  450. m_Region.Width = (int)m_RegionF.Width;
  451. m_Region.Height = (int)m_RegionF.Height;
  452. e.Graphics.DrawRectangle(pen, m_Region);
  453. }
  454. //绘制多边形测量区域
  455. else if (createType == CreateRectangleType.CircleByThreePoints)
  456. {
  457. Color myColor = selColor;
  458. Pen p = new Pen(myColor, 1);
  459. var m_Region = new Rectangle();
  460. m_Region.X = (int)m_RegionF.X;
  461. m_Region.Y = (int)m_RegionF.Y;
  462. m_Region.Width = (int)m_RegionF.Width;
  463. m_Region.Height = (int)m_RegionF.Height;
  464. e.Graphics.DrawEllipse(p, m_Region);
  465. }
  466. }
  467. public Image BSEImage
  468. {
  469. get { return bseImage; }
  470. set { bseImage = value; }
  471. }
  472. public float BSEImageWitdh
  473. {
  474. get { return bseImageWidth; }
  475. set { bseImageWidth = value; }
  476. }
  477. public float BSEImageHeight
  478. {
  479. get { return bseImageHeight; }
  480. set { bseImageHeight = value; }
  481. }
  482. public PointF BSEImageLocation
  483. {
  484. get { return bseImageLocation; }
  485. set { bseImageLocation = value; }
  486. }
  487. public Color LineColor
  488. {
  489. get { return lineColor; }
  490. set { lineColor = value; }
  491. }
  492. public float LineLength
  493. {
  494. get { return lineLength; }
  495. set { lineLength = value; }
  496. }
  497. public PointF LineStartPoint
  498. {
  499. get { return lineStartPoint; }
  500. set { lineStartPoint = value; }
  501. }
  502. public int OTSX
  503. {
  504. get { return otsX; }
  505. set { otsX = value; }
  506. }
  507. public int OTSY
  508. {
  509. get { return otsY; }
  510. set { otsY = value; }
  511. }
  512. public CreateRectangleType CreateType
  513. {
  514. get { return createType; }
  515. set { createType = value; }
  516. }
  517. public ShapeType Shape
  518. {
  519. get { return shape; }
  520. set { shape = value; }
  521. }
  522. public Color SelColor
  523. {
  524. get { return selColor; }
  525. set { selColor = value; }
  526. }
  527. public string NameOrHoleName//holename when they are not field rectangle gdi object.
  528. {
  529. get { return nameOrHoleName; }
  530. set { nameOrHoleName = value; }
  531. }
  532. public string ID
  533. {
  534. get { return id; }
  535. set { id = value; }
  536. }
  537. public string SampleName
  538. {
  539. get { return sampleName; }
  540. set { sampleName = value; }
  541. }
  542. public int SampleCount
  543. {
  544. get { return sampleCount; }
  545. set { sampleCount = value; }
  546. }
  547. public string StrContent
  548. {
  549. get { return strContent; }
  550. set { strContent = value; }
  551. }
  552. public RectangleF GetZoomedRegion
  553. {
  554. get {
  555. var m_Region = new RectangleF();
  556. m_Region.X = m_RegionF.X;
  557. m_Region.Y = m_RegionF.Y;
  558. m_Region.Width = m_RegionF.Width;
  559. m_Region.Height = m_RegionF.Height;
  560. return m_Region;
  561. }
  562. }
  563. public List<PointF> GetVertexPoints()
  564. {
  565. List<PointF> vertexPoint = new List<PointF>();
  566. var region = this.GetZoomedRegionF();
  567. vertexPoint.Add(region.Location);
  568. vertexPoint.Add(new PointF(region.X, region.Y + region.Height));
  569. vertexPoint.Add(new PointF(region.X + region.Width, region.Y));
  570. vertexPoint.Add(new PointF(region.X + region.Width, region.Y + region.Height));
  571. return vertexPoint;
  572. }
  573. public RectangleF GetZoomedRegionF()
  574. {
  575. return m_RegionF;
  576. }
  577. public void SetInitRegionF(RectangleF OrigineRegionF)//not zoomed regine value
  578. {
  579. float x1, y1;
  580. x1 = OrigineRegionF.X * m_zoomNum + m_refPoint.X;
  581. y1 = OrigineRegionF.Y * m_zoomNum + m_refPoint.Y;
  582. float w1, h1;
  583. w1 = OrigineRegionF.Width * m_zoomNum;
  584. h1 = OrigineRegionF.Height * m_zoomNum;
  585. m_OrigineRegionF = OrigineRegionF;
  586. m_RegionF = new RectangleF(x1, y1, w1, h1);
  587. }
  588. internal void SetZoomedRegionF(RectangleF scaleRectangleF)
  589. {
  590. float x1, y1;
  591. x1 = (scaleRectangleF.X-m_refPoint.X) / m_zoomNum ;
  592. y1 = (scaleRectangleF.Y-m_refPoint.Y) / m_zoomNum ;
  593. float w1, h1;
  594. w1 = scaleRectangleF.Width / m_zoomNum;
  595. h1 = scaleRectangleF.Height / m_zoomNum;
  596. m_OrigineRegionF = new RectangleF(x1, y1, w1, h1);
  597. m_RegionF = scaleRectangleF;
  598. }
  599. private Rectangle GetMinRectangleOfPolygon(List<PointF> polygonPointList)
  600. {
  601. if (polygonPointList != null)
  602. {
  603. if (polygonPointList.Count > 0)
  604. {
  605. int pCount = polygonPointList.Count;
  606. float minX = polygonPointList[0].X;
  607. float minY = polygonPointList[0].Y;
  608. float maxX = polygonPointList[0].X;
  609. float maxY = polygonPointList[0].Y;
  610. //获取最小X,Y 最大X,Y
  611. for (int i = 0; i < pCount; i++)
  612. {
  613. minX = Math.Min(minX, polygonPointList[i].X);
  614. minY = Math.Min(minY, polygonPointList[i].Y);
  615. maxX = Math.Max(maxX, polygonPointList[i].X);
  616. maxY = Math.Max(maxY, polygonPointList[i].Y);
  617. }
  618. //创建外接矩形
  619. Rectangle rect = new Rectangle();
  620. rect.Location = new Point((int)minX, (int)minY);
  621. rect.Size = new Size((int)maxX - (int)minX, (int)maxY - (int)minY);
  622. return rect;
  623. }
  624. }
  625. return new Rectangle();
  626. }
  627. public RectangleF GetOrigionalDrawRegionF()
  628. { return m_OrigineRegionF; }
  629. public List<PointF> GetOriginalPolygonPointFList()
  630. { return m_originalPolygonPoints; }
  631. public void SetOriginalPolygonPointFList(List<PointF> value)
  632. {
  633. if (m_zoomNum != 1)
  634. {
  635. var ps = new List<PointF>();
  636. foreach (var p in value)
  637. {
  638. var p1 = new PointF();
  639. p1.X = p.X * m_zoomNum+m_refPoint.X;
  640. p1.Y = p.Y *m_zoomNum+ m_refPoint.Y;
  641. ps.Add(p1);
  642. }
  643. m_PolygonPoints = ps;
  644. m_originalPolygonPoints = value;
  645. }
  646. else
  647. {
  648. m_originalPolygonPoints = value;
  649. m_PolygonPoints = value;
  650. }
  651. }
  652. public List<PointF> GetPolygonPointFList()
  653. { return m_PolygonPoints; }
  654. public void SetPolygonPointFList(List<PointF> value)
  655. {
  656. if (m_zoomNum != 1)
  657. {
  658. var ps = new List<PointF>();
  659. foreach (var p in value)
  660. {
  661. var p1 = new PointF();
  662. p1.X = (p.X - m_refPoint.X) / m_zoomNum;
  663. p1.Y = (p.Y - m_refPoint.Y) / m_zoomNum;
  664. ps.Add(p1);
  665. }
  666. m_originalPolygonPoints = ps;
  667. m_PolygonPoints = value;
  668. }
  669. else
  670. {
  671. m_originalPolygonPoints = value;
  672. m_PolygonPoints = value;
  673. }
  674. var region = GetMinRectangleOfPolygon(m_PolygonPoints);
  675. SetZoomedRegionF(region);
  676. }
  677. public GraphicsPath GetGPath()
  678. {
  679. var measureItem = this;
  680. //重新绘制测量区域路径
  681. GraphicsPath GPath = new GraphicsPath();
  682. if (measureItem.CreateType == CreateRectangleType.Polygon)
  683. {
  684. GraphicsPath PolygonMeasurePath = new GraphicsPath();
  685. PolygonMeasurePath.AddPolygon(measureItem.GetPolygonPointFList().ToArray());
  686. GPath = PolygonMeasurePath;
  687. }
  688. else if (measureItem.CreateType == CreateRectangleType.CircleByThreePoints)
  689. {
  690. GPath.AddEllipse(GetZoomedRegionF());
  691. }
  692. else
  693. {
  694. if (measureItem.Shape == (int)CreateRectangleType.Circle)
  695. {
  696. GPath.AddEllipse(GetZoomedRegionF());
  697. }
  698. else
  699. {
  700. GPath.AddRectangle(GetZoomedRegionF());
  701. }
  702. }
  703. return GPath;
  704. }
  705. public PointF PolygonDrawingEndPoint
  706. {
  707. get { return endPoint; }
  708. set { endPoint = value; }
  709. }
  710. public Point GetZoomedCenterPoint()
  711. {
  712. Point pCenterPoint = new Point();
  713. //获取在工作窗口中X,Y位置
  714. pCenterPoint.X = (int)(this.GetZoomedRegion.X + this.GetZoomedRegion.Width / 2);
  715. pCenterPoint.Y = (int)(this.GetZoomedRegion.Y + this.GetZoomedRegion.Height / 2);
  716. return pCenterPoint;
  717. }
  718. public PointF GetCenterPoint()
  719. {
  720. PointF pCenterPoint = new PointF();
  721. //获取在工作窗口中X,Y位置
  722. pCenterPoint.X = (this.GetOrigionalDrawRegionF().X + this.GetOrigionalDrawRegionF().Width / 2);
  723. pCenterPoint.Y = (this.GetOrigionalDrawRegionF().Y + this.GetOrigionalDrawRegionF().Height / 2);
  724. return pCenterPoint;
  725. }
  726. #endregion
  727. public bool IsDragging
  728. {
  729. get { return m_IsDragging; }
  730. set { m_IsDragging = value; }
  731. }
  732. public bool IsAltering// changing the size by gui operating.
  733. {
  734. get { return m_IsAlter; }
  735. set { m_IsAlter = value; }
  736. }
  737. public bool IsWorkSample
  738. {
  739. get { return m_IsWorkSample; }
  740. set { m_IsWorkSample = value; }
  741. }
  742. public PointF DraggingPoint
  743. {
  744. get { return m_DraggingPoint; }
  745. set {
  746. m_DraggingPoint = value;
  747. if (subItems.Count != 0)
  748. {
  749. foreach (var item in subItems)
  750. {
  751. item.DraggingPoint = m_DraggingPoint;
  752. }
  753. }
  754. }
  755. }
  756. public int SequenceNum { get => m_sequenceNum; set => m_sequenceNum = value; }
  757. public bool IsMoving { get => m_IsMoving; set => m_IsMoving = value; }
  758. public PointF GetDisplayRefPoint()
  759. { return m_refPoint; }
  760. public void SetDisplayRefPoint(PointF value)
  761. {
  762. m_refPoint = value;
  763. SetInitRegionF(m_OrigineRegionF);
  764. if (m_originalPolygonPoints.Count != 0)
  765. {
  766. this.SetPolygonPointFList(m_originalPolygonPoints);
  767. }
  768. }
  769. public float GetZoomNumber()
  770. { return m_zoomNum; }
  771. public void SetZoomNumber(float value)
  772. {
  773. m_zoomNum = value;
  774. SetInitRegionF(m_OrigineRegionF);
  775. if (m_originalPolygonPoints.Count != 0)
  776. {
  777. this.SetPolygonPointFList(m_originalPolygonPoints);
  778. }
  779. }
  780. #region 画圆角矩形
  781. internal static GraphicsPath CreateRoundedRectanglePath(RectangleF rect, int cornerRadius)
  782. {
  783. GraphicsPath roundedRect = new GraphicsPath();
  784. roundedRect.AddArc(rect.X, rect.Y, cornerRadius * 2, cornerRadius * 2, 180, 90);
  785. roundedRect.AddLine(rect.X + cornerRadius, rect.Y, rect.Right - cornerRadius * 2, rect.Y);
  786. roundedRect.AddArc(rect.X + rect.Width - cornerRadius * 2, rect.Y, cornerRadius * 2, cornerRadius * 2, 270, 90);
  787. roundedRect.AddLine(rect.Right, rect.Y + cornerRadius * 2, rect.Right, rect.Y + rect.Height - cornerRadius * 2);
  788. roundedRect.AddArc(rect.X + rect.Width - cornerRadius * 2, rect.Y + rect.Height - cornerRadius * 2, cornerRadius * 2, cornerRadius * 2, 0, 90);
  789. roundedRect.AddLine(rect.Right - cornerRadius * 2, rect.Bottom, rect.X + cornerRadius * 2, rect.Bottom);
  790. roundedRect.AddArc(rect.X, rect.Bottom - cornerRadius * 2, cornerRadius * 2, cornerRadius * 2, 90, 90);
  791. roundedRect.AddLine(rect.X, rect.Bottom - cornerRadius * 2, rect.X, rect.Y + cornerRadius * 2);
  792. roundedRect.CloseFigure();
  793. return roundedRect;
  794. }
  795. public bool IfZoomContains(Point mousePoint)
  796. {
  797. if (mousePoint.X > m_RegionF.Left && mousePoint.X < m_RegionF.Left + m_RegionF.Width)
  798. {
  799. if (mousePoint.Y > m_RegionF.Top && mousePoint.Y < m_RegionF.Top + m_RegionF.Height)
  800. {
  801. return true;
  802. }
  803. }
  804. return false;
  805. }
  806. public bool IfContains(PointF thePoint)
  807. {
  808. if (thePoint.X > m_OrigineRegionF.Left && thePoint.X < m_OrigineRegionF.Left + m_OrigineRegionF.Width)
  809. {
  810. if (thePoint.Y > m_OrigineRegionF.Top && thePoint.Y < m_OrigineRegionF.Top + m_OrigineRegionF.Height)
  811. {
  812. return true;
  813. }
  814. }
  815. return false;
  816. }
  817. public List<CDisplayGDIObject> SubItems()
  818. {
  819. if (subItems == null) subItems = new List<CDisplayGDIObject>();
  820. return subItems;
  821. }
  822. public void AddSubItems(CDisplayGDIObject item)
  823. {
  824. if (subItems == null) subItems = new List<CDisplayGDIObject>();
  825. subItems.Add(item);
  826. }
  827. public void ClearSubItems()
  828. {
  829. subItems.Clear();
  830. }
  831. public void Zoom(PointF mousePoint, float zoomNum)
  832. {
  833. float X1;
  834. float curZoom = m_zoomNum;
  835. float deltaZoom = zoomNum - curZoom;
  836. float Y1;
  837. if (zoomNum == 1)
  838. {
  839. m_zoomNum = 1;
  840. m_RegionF = m_OrigineRegionF;
  841. m_refPoint = new PointF(0, 0);
  842. m_PolygonPoints = m_originalPolygonPoints;
  843. }
  844. else
  845. {
  846. X1 = (m_RegionF.X - mousePoint.X) / curZoom * deltaZoom + m_RegionF.X;
  847. Y1 = (m_RegionF.Y - mousePoint.Y) / curZoom * deltaZoom + m_RegionF.Y;
  848. m_refPoint.X = (m_refPoint.X - mousePoint.X) / curZoom * deltaZoom + m_refPoint.X;
  849. m_refPoint.Y = (m_refPoint.Y - mousePoint.Y) / curZoom * deltaZoom + m_refPoint.Y;
  850. float Width = GetOrigionalDrawRegionF().Width * zoomNum;
  851. float Height = GetOrigionalDrawRegionF().Height * zoomNum;
  852. m_RegionF = new RectangleF(X1, Y1, Width, Height);
  853. m_zoomNum = zoomNum;
  854. }
  855. BSEImageWitdh = m_RegionF.Width;
  856. BSEImageHeight = m_RegionF.Height;
  857. BSEImageLocation = m_RegionF.Location;
  858. var scalePs = new List<PointF>();
  859. foreach (var p in m_PolygonPoints)
  860. {
  861. float x, y;
  862. x = (p.X - mousePoint.X) / curZoom * deltaZoom + p.X;
  863. y = (p.Y - mousePoint.Y) / curZoom * deltaZoom + p.Y;
  864. scalePs.Add(new PointF(x, y));
  865. }
  866. m_PolygonPoints = scalePs;
  867. if (this.subItems.Count != 0)
  868. {
  869. foreach (var g in subItems)
  870. {
  871. g.Zoom(mousePoint,zoomNum);
  872. }
  873. }
  874. }
  875. public void Move(PointF location)
  876. {
  877. PointF offset = new PointF(location.X - DraggingPoint.X, location.Y - DraggingPoint.Y);
  878. float X1;
  879. float Y1;
  880. X1 = (m_RegionF.X + offset.X);
  881. Y1 = (m_RegionF.Y + offset.Y);
  882. m_RegionF = new RectangleF(X1, Y1, m_RegionF.Width, m_RegionF.Height);
  883. m_refPoint.X = m_refPoint.X + offset.X;
  884. m_refPoint.Y = m_refPoint.Y + offset.Y;
  885. BSEImageWitdh = m_RegionF.Width;
  886. BSEImageHeight = m_RegionF.Height;
  887. BSEImageLocation = m_RegionF.Location;
  888. //SEMCenterPoint = m_RegionF.Location;
  889. LineStartPoint = m_RegionF.Location;
  890. m_DraggingPoint = new Point((int)location.X,(int)location.Y);
  891. var scalePs = new List<PointF>();
  892. foreach (var p in m_PolygonPoints)
  893. {
  894. float x, y;
  895. x = (p.X + offset.X);
  896. y = (p.Y + offset.Y);
  897. scalePs.Add(new PointF(x, y));
  898. }
  899. m_PolygonPoints = scalePs;
  900. if (this.subItems.Count != 0)
  901. {
  902. foreach (var g in subItems)
  903. {
  904. g.Move(location);
  905. }
  906. }
  907. }
  908. public void PositionAltering(PointF location,bool ifZoomCoord)
  909. {
  910. PointF offset = new PointF(location.X - DraggingPoint.X, location.Y - DraggingPoint.Y);
  911. PointF realShift;
  912. if (ifZoomCoord)
  913. {
  914. realShift = new PointF(offset.X / m_zoomNum, offset.Y / m_zoomNum);
  915. }
  916. else
  917. {
  918. realShift = new PointF(offset.X , offset.Y );
  919. }
  920. m_OrigineRegionF = new RectangleF(m_OrigineRegionF.X+realShift.X, m_OrigineRegionF.Y+realShift.Y, m_OrigineRegionF.Width, m_OrigineRegionF.Height);
  921. SetInitRegionF(m_OrigineRegionF);
  922. BSEImageWitdh = m_RegionF.Width;
  923. BSEImageHeight = m_RegionF.Height;
  924. BSEImageLocation = m_RegionF.Location;
  925. LineStartPoint = m_RegionF.Location;
  926. var scalePs = new List<PointF>();
  927. var OriginalPs = new List<PointF>();
  928. foreach (var p in m_PolygonPoints)
  929. {
  930. float x, y;
  931. x = (p.X + offset.X);
  932. y = (p.Y + offset.Y);
  933. scalePs.Add(new PointF(x, y));
  934. }
  935. m_PolygonPoints = scalePs;
  936. foreach (var p in m_originalPolygonPoints)
  937. {
  938. OriginalPs.Add(new PointF(p.X + realShift.X, p.Y + realShift.Y));
  939. }
  940. m_originalPolygonPoints = OriginalPs;
  941. m_DraggingPoint = new Point((int)location.X, (int)location.Y);
  942. if (this.subItems.Count != 0)
  943. {
  944. foreach (var g in subItems)
  945. {
  946. g.PositionAltering(location,ifZoomCoord);
  947. }
  948. }
  949. }
  950. public CDisplayGDIObject Duplicate(CreateRectangleType newType)
  951. {
  952. CDisplayGDIObject r = new CDisplayGDIObject();
  953. r.NameOrHoleName = this.nameOrHoleName;
  954. r.SampleName = this.SampleName;
  955. r.m_OrigineRegionF = this.m_OrigineRegionF;
  956. r.IsWorkSample = this.IsWorkSample;
  957. r.m_RegionF = this.m_RegionF;
  958. r.m_refPoint = this.m_refPoint;
  959. r.m_zoomNum = this.m_zoomNum;
  960. r.shape = this.shape;
  961. r.createType = newType;
  962. return r;
  963. }
  964. virtual public bool ifRectangleIntersect(CDisplayGDIObject othergdi)
  965. {
  966. return true;
  967. }
  968. #endregion
  969. //是否设置为选择样品
  970. private bool m_IsAlter;
  971. //是否存在帧图信息
  972. //是否设置为拖动
  973. private bool m_IsDragging;
  974. private bool m_IsMoving;
  975. //是否为工作样品
  976. private bool m_IsWorkSample;
  977. private CreateRectangleType createType;
  978. private ShapeType shape;
  979. private string id;
  980. protected string nameOrHoleName="";
  981. public string sampleName="";
  982. //样品孔中样品的数量
  983. public int sampleCount = 0;
  984. public string strContent;
  985. private Color selColor;
  986. private PointF m_DraggingPoint;
  987. private int m_sequenceNum;
  988. protected RectangleF m_RegionF;
  989. //绘制时与移动缩放时记录的位置与尺寸
  990. protected RectangleF m_OrigineRegionF;
  991. private PointF startPoint;
  992. private PointF endPoint;
  993. //绘制颗粒图
  994. private Color lineColor;
  995. private float lineLength;
  996. private PointF lineStartPoint;
  997. private int otsX;
  998. private int otsY;
  999. //绘制样品孔BSE图像
  1000. private Image bseImage;
  1001. //绘制样品孔BSE图像宽度
  1002. private float bseImageWidth;
  1003. //绘制样品孔BSE图像高度
  1004. private float bseImageHeight;
  1005. //绘制样品孔BSE图像位置
  1006. private PointF bseImageLocation;
  1007. //绘制SEM中心位置
  1008. private PointF semCenterPoint;
  1009. private List<PointF> m_PolygonPoints=new List<PointF>();
  1010. //绘制时与移动缩放时记录的位置
  1011. private List<PointF> m_originalPolygonPoints = new List<PointF>();
  1012. private List<CDisplayGDIObject> subItems=new List<CDisplayGDIObject>();
  1013. protected float m_zoomNum=1;
  1014. private PointF m_refPoint=new PointF(0,0);
  1015. }
  1016. public enum XYIndex
  1017. {
  1018. X = 0,
  1019. Y = 1
  1020. }
  1021. public enum CreateRectangleType
  1022. {
  1023. //样品台-圆形
  1024. SampleBackGround_Circle = -1,
  1025. //圆形
  1026. Circle = 0,
  1027. //圆角矩形
  1028. SampleBackGround_Rectangle = 1,
  1029. //样品孔中的文字
  1030. Text = 2,
  1031. //矩形
  1032. Rectangle = 3,
  1033. //选择的样品
  1034. SelectSample = 4,
  1035. //测量区域
  1036. MeasureArea = 5,
  1037. //帧图-直线绘制方式
  1038. SingleLine = 6,
  1039. //表样-矩形
  1040. SpecimenRectangle = 7,
  1041. //表样-圆形
  1042. SpecimenCircle = 8,
  1043. //帧图-矩形绘制
  1044. FieldRectangle = 9,
  1045. //颗粒直线图
  1046. ParticleLine = 10,
  1047. //颗粒分布图 鼠标
  1048. ParticleAreaRectangle = 11,
  1049. //绘制拍摄样品孔BSE照片
  1050. DrawFrameOfHoleBSEImage = 12,
  1051. //绘制sem中心点+
  1052. DrawSEMCenterPoint=13,
  1053. //绘制BSE采集标记
  1054. DrawBSEElementSignPoint = 14,
  1055. //多边形
  1056. Polygon = 15,
  1057. //多边形完成标识
  1058. DrawPolygonFinish = 16,
  1059. //圆形三点法
  1060. CircleByThreePoints=17,
  1061. RingShape=18,
  1062. SampleHoleImageBuffer=19
  1063. }
  1064. public enum ColorType
  1065. {
  1066. FieldColor,//帧图fd8f8f
  1067. RoundRectangleColor,//c8c8c8圆角矩形
  1068. SampleBackGroundColor,//c0c0c0圆角矩形
  1069. FontColor,//90ee90文字颜色
  1070. SampleColor,//f4f4f4 样品未选择
  1071. SampleSelColor//505050 样品选择后
  1072. }
  1073. public enum GrayLevel
  1074. {
  1075. Min=0,
  1076. Max=255
  1077. }
  1078. }