TABMethod4DialogSetting.cs 91 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011
  1. using PaintDotNet.CustomControl;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Drawing.Drawing2D;
  8. using System.Drawing.Imaging;
  9. using System.Windows.Forms;
  10. namespace PaintDotNet.DedicatedAnalysis.NonferrousMetals.YYT098814_2016
  11. {
  12. /// <summary>
  13. /// 组织界面梯度法
  14. /// </summary>
  15. internal class TABMethod4DialogSetting : PdnBaseForm
  16. {
  17. #region 基础控件
  18. private Button button2;
  19. private GroupBox groupBox3;
  20. private ImageList imageList1;
  21. private IContainer components;
  22. private GroupBox groupBox1;
  23. #endregion
  24. /// <summary>
  25. /// 调色板
  26. /// </summary>
  27. PaintDotNet.ColorsForm colorsForm1;
  28. PaintDotNet.ColorsForm colorsForm2;
  29. PaintDotNet.ColorsForm colorsForm3;
  30. PaintDotNet.ColorsForm colorsForm4;
  31. PaintDotNet.ColorsForm colorsForm5;
  32. /// <summary>
  33. /// 主控件
  34. /// </summary>
  35. private AppWorkspace appWorkspace;
  36. /// <summary>
  37. /// 图像面板
  38. /// </summary>
  39. private DocumentWorkspaceWindow documentWorkspace;
  40. /// <summary>
  41. /// 公共按钮
  42. /// </summary>
  43. private CommonControlButtons commonControlButtons;
  44. /// <summary>
  45. /// 检测到的轮廓
  46. /// </summary>
  47. OpenCvSharp.Point[][] contours;
  48. /// <summary>
  49. /// 选中图片的bitmap
  50. /// </summary>
  51. private Bitmap bitmap;
  52. /// <summary>
  53. /// 选择标尺的物理长度(微米/像素)
  54. /// </summary>
  55. double physical_length = 1;
  56. /// <summary>
  57. /// 图像的物理长度
  58. /// </summary>
  59. int physical_width = 1200;
  60. /// <summary>
  61. /// 0:添加 1:选择 2:删除
  62. /// </summary>
  63. private int operationK = -1;
  64. /// <summary>
  65. /// 被选择的线
  66. /// </summary>
  67. private int selected = -1;
  68. /// <summary>
  69. /// 起止点
  70. /// </summary>
  71. private System.Drawing.PointF startPoint, endPoint;
  72. /// <summary>
  73. /// 存储所有线的点集合
  74. /// </summary>
  75. private List<PointF[]> pointList = new List<PointF[]>();
  76. /// <summary>
  77. /// 测量点
  78. /// </summary>
  79. public List<RectangleF> rectangleFList = new List<RectangleF>();
  80. /// <summary>
  81. /// 存储当前线的点集合
  82. /// </summary>
  83. private PointF[] nowLine;
  84. /// <summary>
  85. /// 线的总数
  86. /// </summary>
  87. private int lineCount = 0;
  88. /// <summary>
  89. /// 计算结果的表格集合
  90. /// </summary>
  91. private List<DataTable> resultTableList = new List<DataTable>();
  92. /// <summary>
  93. /// 保存用于生成报告的图片
  94. /// </summary>
  95. private List<Bitmap> bitList;
  96. /// <summary>
  97. /// 储存点击保存结果后的所有原图与分析图
  98. /// </summary>
  99. private Dictionary<string, List<Bitmap>> bitDic = new Dictionary<string, List<Bitmap>>();
  100. /// <summary>
  101. /// 是否显示全部
  102. /// </summary>
  103. private bool showAll = false;
  104. /// <summary>
  105. /// 辅助计算偏移量-移动线两端的点
  106. /// </summary>
  107. private PointF lastPoint = new PointF(0, 0);
  108. /// <summary>
  109. /// 辅助计算偏移量-移动线中间的点
  110. /// </summary>
  111. private PointF tempPoint = new PointF(0, 0);
  112. /// <summary>
  113. /// 判断图形是否可移动
  114. /// </summary>
  115. private bool canMove = false;
  116. /// <summary>
  117. /// 调色板
  118. /// </summary>
  119. private ColorsForm colorsFormGrid;
  120. private Panel panelC;
  121. private Button button10;
  122. private GroupBox groupBox6;
  123. private Panel panel3;
  124. private TrackBar trackBar4;
  125. private TextBox textBox10;
  126. private Label label4;
  127. private Label label6;
  128. private GroupBox groupBox2;
  129. private Panel panel6;
  130. private TrackBar trackBar1;
  131. private TextBox textBox1;
  132. private Label label8;
  133. private Label label9;
  134. private Panel panel9;
  135. private TrackBar trackBar6;
  136. private TextBox textBox6;
  137. private Label label13;
  138. private Label label14;
  139. private Panel panel8;
  140. private TrackBar trackBar5;
  141. private TextBox textBox4;
  142. private Label label11;
  143. private Label label12;
  144. private Panel panel1;
  145. private TrackBar trackBar2;
  146. private TextBox textBox2;
  147. private Label label3;
  148. private Label label5;
  149. private GroupBox groupBox4;
  150. private Panel panel7;
  151. private TextBox textBox3;
  152. private TrackBar trackBar3;
  153. private TextBox textBox5;
  154. private Label label10;
  155. private Label label16;
  156. private Label label18;
  157. private GroupBox groupBox7;
  158. private Panel panel4;
  159. private TrackBar trackBar7;
  160. private TextBox textBox9;
  161. private Label label1;
  162. private Label label2;
  163. /// <summary>
  164. /// 移动线上的哪一个点
  165. /// </summary>
  166. private int movePointIndex = -1;
  167. private GroupBox groupBox5;
  168. private Panel panel2;
  169. private TrackBar trackBar8;
  170. private TextBox textBox7;
  171. private Label label7;
  172. private Label label15;
  173. private TABM4Dialog parentDialog;
  174. public TABMethod4DialogSetting(TABM4Dialog parent, AppWorkspace appWorkspace, int focusedItemIndex)
  175. {
  176. this.parentDialog = parent;
  177. this.appWorkspace = appWorkspace;
  178. InitializeComponent();
  179. InitializeLanguageText();
  180. //
  181. //初始化色板
  182. //
  183. this.colorsFormGrid = new ColorsForm();
  184. this.colorsFormGrid.StartPosition = FormStartPosition.CenterScreen;
  185. this.colorsFormGrid.setSaveBtn_Click(new System.EventHandler(this.gridColorChanged));
  186. InitOtherTools();
  187. if (focusedItemIndex > -1)
  188. {
  189. this.bitmap = new Bitmap(1200, 900, PixelFormat.Format32bppRgb/*Format32bppArgb*/);
  190. Bitmap bitmap11 = this.appWorkspace.DocumentWorkspaces[focusedItemIndex].CompositionSurface.CreateAliasedBitmap();
  191. //Dictionary<MeasurementUnit, double> measurementUnitDictionary = Startup.instance.rules;
  192. double physical_length11 = this.appWorkspace.DocumentWorkspaces[focusedItemIndex].GetRuler(MeasurementUnit.Micron);
  193. //double physical_length11 = measurementUnitDictionary[MeasurementUnit.Micron];
  194. physical_width = (int)(bitmap11.Width * physical_length11);
  195. }
  196. else
  197. this.bitmap = new Bitmap(1200, 900, PixelFormat.Format32bppRgb/*Format32bppArgb*/);
  198. //this.bitmap = new Bitmap(1200, 900, PixelFormat.Format32bppRgb/*Format32bppArgb*/);// this.appWorkspace.DocumentWorkspaces[focusedItemIndex].CompositionSurface.CreateAliasedBitmap();
  199. Document document = Document.FromImage(bitmap);
  200. this.documentWorkspace.Document = document;
  201. this.documentWorkspace.Visible = true;
  202. InitCommonButtonEvent();
  203. AddPictureBoxEvent();
  204. InitVariableParams();
  205. }
  206. /// <summary>
  207. /// 限制只可以输入0-9数字以及退格键
  208. /// </summary>
  209. /// <param name="sender"></param>
  210. /// <param name="e"></param>
  211. private void textBoxWidth_KeyPress(object sender, KeyPressEventArgs e)
  212. {
  213. if (e.KeyChar != '\b')//这是允许输入退格键 
  214.             {
  215. int len = ((TextBox)sender)/*this.textBox1*/.Text.Length;
  216. if (len < 1 && e.KeyChar == '0')
  217. {
  218. e.Handled = true;
  219. }
  220. else if ((e.KeyChar < '0') || (e.KeyChar > '9'))//这是允许输入0-9数字 
  221.                 {
  222. e.Handled = true;
  223. }
  224. }
  225. }
  226. private void InitVariableParams()
  227. {
  228. this.trackBar8.Value = this.parentDialog.rectLineWidth;
  229. this.textBox7.Text = this.trackBar8.Value.ToString();
  230. this.trackBar1.Value = this.parentDialog.baseLineWidth;
  231. this.textBox1.Text = this.trackBar1.Value.ToString();
  232. this.trackBar3.Value = this.parentDialog.scopeLineWidth;
  233. this.textBox5.Text = this.trackBar3.Value.ToString();
  234. this.trackBar4.Value = this.parentDialog.orgLineWidth;
  235. this.textBox10.Text = this.trackBar4.Value.ToString();
  236. this.trackBar2.Value = this.parentDialog.rect1LineWidth;
  237. this.textBox2.Text = this.trackBar2.Value.ToString();
  238. this.trackBar5.Value = this.parentDialog.rect2LineWidth;
  239. this.textBox4.Text = this.trackBar5.Value.ToString();
  240. this.trackBar6.Value = this.parentDialog.rect3LineWidth;
  241. this.textBox6.Text = this.trackBar6.Value.ToString();
  242. this.trackBar7.Value = this.parentDialog.assistLineWidth;
  243. this.textBox9.Text = this.trackBar7.Value.ToString();
  244. this.textBox3.Text = parentDialog.scopeMarginLeft/*this.trackBar7.Value*/.ToString();
  245. this.panel2.BackColor = this.parentDialog.rectLineColor;
  246. this.panel6.BackColor = this.parentDialog.baseLineColor;
  247. this.panel7.BackColor = this.parentDialog.scopeLineColor;
  248. this.panel3.BackColor = this.parentDialog.orgLineColor;
  249. this.panel1.BackColor = this.parentDialog.rect1LineColor;
  250. this.panel8.BackColor = this.parentDialog.rect2LineColor;
  251. this.panel9.BackColor = this.parentDialog.rect3LineColor;
  252. this.panel4.BackColor = this.parentDialog.assistLineColor;
  253. }
  254. private void InitializeLanguageText()
  255. {
  256. this.groupBox1.Text = PdnResources.GetString("Menu.operation.text");
  257. this.button10.Text = PdnResources.GetString("Menu.File.Close.Text");
  258. this.button2.Text = PdnResources.GetString("CommonAction.Save");
  259. this.groupBox3.Text = PdnResources.GetString("Menu.Preview.text");
  260. this.groupBox5.Text = "轮廓线设置";
  261. this.label15.Text = "轮廓线颜色" + ":";
  262. this.label7.Text = "轮廓线线宽" + ":";
  263. this.groupBox6.Text = "区域线设置";// PdnResources.GetString("Menu.Organizationlinesettings.text");
  264. this.label13.Text = PdnResources.GetString("Menu.realinewidth.Text") + ":";
  265. this.label14.Text = PdnResources.GetString("Menu.realinewcolor.Text") + ":";
  266. this.label11.Text = PdnResources.GetString("Menu.realin2ewcolor.Text") + ":";
  267. this.label12.Text = PdnResources.GetString("Menu.realin2ss.Text") + ":";
  268. this.label3.Text = PdnResources.GetString("Menu.Linewidthofarea1.text") + ":";
  269. this.label5.Text = PdnResources.GetString("Menu.Linecolorofarea1.text") + ":";
  270. this.label4.Text = PdnResources.GetString("Menu.Organizationlinewidth.text") + ":";
  271. this.label6.Text = PdnResources.GetString("Menu.Organizationlinecolor.text") + ":";
  272. this.groupBox2.Text = PdnResources.GetString("Menu.Baselinesettings.text");
  273. this.label8.Text = PdnResources.GetString("Menu.Baselinewidth.text") + ":";
  274. this.label9.Text = PdnResources.GetString("Menu.Baselinecolor.text") + ":";
  275. this.groupBox4.Text = PdnResources.GetString("Menu.Rangesetting.text");
  276. this.label10.Text = PdnResources.GetString("Menu.Distancefromtherangelinetotheboundary.text") + ":";
  277. this.label16.Text = PdnResources.GetString("Menu.Rangelinewidth.text") + ":";
  278. this.label18.Text = PdnResources.GetString("Menu.Rangelinecolor.text") + ":";
  279. this.groupBox7.Text = PdnResources.GetString("Menu.Auxiliarylinesettings.text");
  280. this.label1.Text = PdnResources.GetString("Menu.Auxiliarylinewidth.text") + ":";
  281. this.label2.Text = PdnResources.GetString("Menu.Auxiliarylinecolor.text") + ":";
  282. this.Text = PdnResources.GetString("Menu.Organizationdefinesmoresettings.text");
  283. }
  284. private void InitializeComponent()
  285. {
  286. this.components = new System.ComponentModel.Container();
  287. this.groupBox1 = new System.Windows.Forms.GroupBox();
  288. this.button10 = new System.Windows.Forms.Button();
  289. this.button2 = new System.Windows.Forms.Button();
  290. this.imageList1 = new System.Windows.Forms.ImageList(this.components);
  291. this.groupBox3 = new System.Windows.Forms.GroupBox();
  292. this.groupBox6 = new System.Windows.Forms.GroupBox();
  293. this.panel9 = new System.Windows.Forms.Panel();
  294. this.trackBar6 = new System.Windows.Forms.TrackBar();
  295. this.textBox6 = new System.Windows.Forms.TextBox();
  296. this.label13 = new System.Windows.Forms.Label();
  297. this.label14 = new System.Windows.Forms.Label();
  298. this.panel8 = new System.Windows.Forms.Panel();
  299. this.trackBar5 = new System.Windows.Forms.TrackBar();
  300. this.textBox4 = new System.Windows.Forms.TextBox();
  301. this.label11 = new System.Windows.Forms.Label();
  302. this.label12 = new System.Windows.Forms.Label();
  303. this.panel1 = new System.Windows.Forms.Panel();
  304. this.trackBar2 = new System.Windows.Forms.TrackBar();
  305. this.textBox2 = new System.Windows.Forms.TextBox();
  306. this.label3 = new System.Windows.Forms.Label();
  307. this.label5 = new System.Windows.Forms.Label();
  308. this.panel3 = new System.Windows.Forms.Panel();
  309. this.trackBar4 = new System.Windows.Forms.TrackBar();
  310. this.textBox10 = new System.Windows.Forms.TextBox();
  311. this.label4 = new System.Windows.Forms.Label();
  312. this.label6 = new System.Windows.Forms.Label();
  313. this.groupBox2 = new System.Windows.Forms.GroupBox();
  314. this.panel6 = new System.Windows.Forms.Panel();
  315. this.trackBar1 = new System.Windows.Forms.TrackBar();
  316. this.textBox1 = new System.Windows.Forms.TextBox();
  317. this.label8 = new System.Windows.Forms.Label();
  318. this.label9 = new System.Windows.Forms.Label();
  319. this.groupBox4 = new System.Windows.Forms.GroupBox();
  320. this.panel7 = new System.Windows.Forms.Panel();
  321. this.textBox3 = new System.Windows.Forms.TextBox();
  322. this.trackBar3 = new System.Windows.Forms.TrackBar();
  323. this.textBox5 = new System.Windows.Forms.TextBox();
  324. this.label10 = new System.Windows.Forms.Label();
  325. this.label16 = new System.Windows.Forms.Label();
  326. this.label18 = new System.Windows.Forms.Label();
  327. this.groupBox7 = new System.Windows.Forms.GroupBox();
  328. this.panel4 = new System.Windows.Forms.Panel();
  329. this.trackBar7 = new System.Windows.Forms.TrackBar();
  330. this.textBox9 = new System.Windows.Forms.TextBox();
  331. this.label1 = new System.Windows.Forms.Label();
  332. this.label2 = new System.Windows.Forms.Label();
  333. this.groupBox5 = new System.Windows.Forms.GroupBox();
  334. this.panel2 = new System.Windows.Forms.Panel();
  335. this.trackBar8 = new System.Windows.Forms.TrackBar();
  336. this.textBox7 = new System.Windows.Forms.TextBox();
  337. this.label7 = new System.Windows.Forms.Label();
  338. this.label15 = new System.Windows.Forms.Label();
  339. this.groupBox1.SuspendLayout();
  340. this.groupBox6.SuspendLayout();
  341. ((System.ComponentModel.ISupportInitialize)(this.trackBar6)).BeginInit();
  342. ((System.ComponentModel.ISupportInitialize)(this.trackBar5)).BeginInit();
  343. ((System.ComponentModel.ISupportInitialize)(this.trackBar2)).BeginInit();
  344. ((System.ComponentModel.ISupportInitialize)(this.trackBar4)).BeginInit();
  345. this.groupBox2.SuspendLayout();
  346. ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit();
  347. this.groupBox4.SuspendLayout();
  348. ((System.ComponentModel.ISupportInitialize)(this.trackBar3)).BeginInit();
  349. this.groupBox7.SuspendLayout();
  350. ((System.ComponentModel.ISupportInitialize)(this.trackBar7)).BeginInit();
  351. this.groupBox5.SuspendLayout();
  352. ((System.ComponentModel.ISupportInitialize)(this.trackBar8)).BeginInit();
  353. this.SuspendLayout();
  354. //
  355. // groupBox1
  356. //
  357. this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  358. | System.Windows.Forms.AnchorStyles.Right)));
  359. this.groupBox1.Controls.Add(this.button10);
  360. this.groupBox1.Controls.Add(this.button2);
  361. this.groupBox1.Location = new System.Drawing.Point(14, 3);
  362. this.groupBox1.Name = "groupBox1";
  363. this.groupBox1.Size = new System.Drawing.Size(847, 50);
  364. this.groupBox1.TabIndex = 1;
  365. this.groupBox1.TabStop = false;
  366. //
  367. // button10
  368. //
  369. this.button10.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  370. | System.Windows.Forms.AnchorStyles.Right)));
  371. this.button10.Location = new System.Drawing.Point(661, 14);
  372. this.button10.Name = "button10";
  373. this.button10.Size = new System.Drawing.Size(84, 30);
  374. this.button10.TabIndex = 3;
  375. this.button10.UseVisualStyleBackColor = true;
  376. this.button10.Click += new System.EventHandler(this.button10_Click);
  377. //
  378. // button2
  379. //
  380. this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  381. | System.Windows.Forms.AnchorStyles.Right)));
  382. this.button2.Location = new System.Drawing.Point(751, 14);
  383. this.button2.Name = "button2";
  384. this.button2.Size = new System.Drawing.Size(84, 30);
  385. this.button2.TabIndex = 2;
  386. this.button2.UseVisualStyleBackColor = true;
  387. this.button2.Click += new System.EventHandler(this.button2_Click);
  388. //
  389. // imageList1
  390. //
  391. this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
  392. this.imageList1.ImageSize = new System.Drawing.Size(64, 64);
  393. this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
  394. //
  395. // groupBox3
  396. //
  397. this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  398. | System.Windows.Forms.AnchorStyles.Right)));
  399. this.groupBox3.Location = new System.Drawing.Point(387, 60);
  400. this.groupBox3.Name = "groupBox3";
  401. this.groupBox3.Size = new System.Drawing.Size(475, 385);
  402. this.groupBox3.TabIndex = 3;
  403. this.groupBox3.TabStop = false;
  404. //
  405. // groupBox6
  406. //
  407. this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  408. | System.Windows.Forms.AnchorStyles.Right)));
  409. this.groupBox6.Controls.Add(this.panel9);
  410. this.groupBox6.Controls.Add(this.trackBar6);
  411. this.groupBox6.Controls.Add(this.textBox6);
  412. this.groupBox6.Controls.Add(this.label13);
  413. this.groupBox6.Controls.Add(this.label14);
  414. this.groupBox6.Controls.Add(this.panel8);
  415. this.groupBox6.Controls.Add(this.trackBar5);
  416. this.groupBox6.Controls.Add(this.textBox4);
  417. this.groupBox6.Controls.Add(this.label11);
  418. this.groupBox6.Controls.Add(this.label12);
  419. this.groupBox6.Controls.Add(this.panel1);
  420. this.groupBox6.Controls.Add(this.trackBar2);
  421. this.groupBox6.Controls.Add(this.textBox2);
  422. this.groupBox6.Controls.Add(this.label3);
  423. this.groupBox6.Controls.Add(this.label5);
  424. this.groupBox6.Controls.Add(this.panel3);
  425. this.groupBox6.Controls.Add(this.trackBar4);
  426. this.groupBox6.Controls.Add(this.textBox10);
  427. this.groupBox6.Controls.Add(this.label4);
  428. this.groupBox6.Controls.Add(this.label6);
  429. this.groupBox6.Location = new System.Drawing.Point(14, 202);
  430. this.groupBox6.Name = "groupBox6";
  431. this.groupBox6.Size = new System.Drawing.Size(353, 122);
  432. this.groupBox6.TabIndex = 15;
  433. this.groupBox6.TabStop = false;
  434. //
  435. // panel9
  436. //
  437. this.panel9.BackColor = System.Drawing.Color.DarkSeaGreen;
  438. this.panel9.Location = new System.Drawing.Point(104, 93);
  439. this.panel9.Name = "panel9";
  440. this.panel9.Size = new System.Drawing.Size(40, 21);
  441. this.panel9.TabIndex = 37;
  442. this.panel9.Click += new System.EventHandler(this.panel6_Click);
  443. //
  444. // trackBar6
  445. //
  446. this.trackBar6.AutoSize = false;
  447. this.trackBar6.Cursor = System.Windows.Forms.Cursors.Hand;
  448. this.trackBar6.Location = new System.Drawing.Point(227, 94);
  449. this.trackBar6.Maximum = 50;
  450. this.trackBar6.Minimum = 1;
  451. this.trackBar6.Name = "trackBar6";
  452. this.trackBar6.Size = new System.Drawing.Size(71, 21);
  453. this.trackBar6.TabIndex = 36;
  454. this.trackBar6.TickStyle = System.Windows.Forms.TickStyle.None;
  455. this.trackBar6.Value = 3;
  456. this.trackBar6.Scroll += new System.EventHandler(this.trackBar6_Scroll);
  457. //
  458. // textBox6
  459. //
  460. this.textBox6.Location = new System.Drawing.Point(304, 93);
  461. this.textBox6.Name = "textBox6";
  462. this.textBox6.Size = new System.Drawing.Size(35, 21);
  463. this.textBox6.TabIndex = 35;
  464. this.textBox6.Text = "3";
  465. this.textBox6.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBoxWidth_KeyPress);
  466. this.textBox6.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textBox6_KeyUp);
  467. //
  468. // label13
  469. //
  470. this.label13.AutoSize = true;
  471. this.label13.Location = new System.Drawing.Point(150, 98);
  472. this.label13.Name = "label13";
  473. this.label13.Size = new System.Drawing.Size(0, 12);
  474. this.label13.TabIndex = 34;
  475. //
  476. // label14
  477. //
  478. this.label14.AutoSize = true;
  479. this.label14.Location = new System.Drawing.Point(15, 98);
  480. this.label14.Name = "label14";
  481. this.label14.Size = new System.Drawing.Size(0, 12);
  482. this.label14.TabIndex = 33;
  483. //
  484. // panel8
  485. //
  486. this.panel8.BackColor = System.Drawing.Color.YellowGreen;
  487. this.panel8.Location = new System.Drawing.Point(104, 68);
  488. this.panel8.Name = "panel8";
  489. this.panel8.Size = new System.Drawing.Size(40, 21);
  490. this.panel8.TabIndex = 32;
  491. this.panel8.Click += new System.EventHandler(this.panel6_Click);
  492. //
  493. // trackBar5
  494. //
  495. this.trackBar5.AutoSize = false;
  496. this.trackBar5.Cursor = System.Windows.Forms.Cursors.Hand;
  497. this.trackBar5.Location = new System.Drawing.Point(227, 69);
  498. this.trackBar5.Maximum = 50;
  499. this.trackBar5.Minimum = 1;
  500. this.trackBar5.Name = "trackBar5";
  501. this.trackBar5.Size = new System.Drawing.Size(71, 21);
  502. this.trackBar5.TabIndex = 31;
  503. this.trackBar5.TickStyle = System.Windows.Forms.TickStyle.None;
  504. this.trackBar5.Value = 3;
  505. this.trackBar5.Scroll += new System.EventHandler(this.trackBar5_Scroll);
  506. //
  507. // textBox4
  508. //
  509. this.textBox4.Location = new System.Drawing.Point(304, 68);
  510. this.textBox4.Name = "textBox4";
  511. this.textBox4.Size = new System.Drawing.Size(35, 21);
  512. this.textBox4.TabIndex = 30;
  513. this.textBox4.Text = "3";
  514. this.textBox4.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBoxWidth_KeyPress);
  515. this.textBox4.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textBox4_KeyUp);
  516. //
  517. // label11
  518. //
  519. this.label11.AutoSize = true;
  520. this.label11.Location = new System.Drawing.Point(150, 73);
  521. this.label11.Name = "label11";
  522. this.label11.Size = new System.Drawing.Size(0, 12);
  523. this.label11.TabIndex = 29;
  524. //
  525. // label12
  526. //
  527. this.label12.AutoSize = true;
  528. this.label12.Location = new System.Drawing.Point(15, 73);
  529. this.label12.Name = "label12";
  530. this.label12.Size = new System.Drawing.Size(0, 12);
  531. this.label12.TabIndex = 28;
  532. //
  533. // panel1
  534. //
  535. this.panel1.BackColor = System.Drawing.Color.MediumSpringGreen;
  536. this.panel1.Location = new System.Drawing.Point(104, 43);
  537. this.panel1.Name = "panel1";
  538. this.panel1.Size = new System.Drawing.Size(40, 21);
  539. this.panel1.TabIndex = 27;
  540. this.panel1.Click += new System.EventHandler(this.panel6_Click);
  541. //
  542. // trackBar2
  543. //
  544. this.trackBar2.AutoSize = false;
  545. this.trackBar2.Cursor = System.Windows.Forms.Cursors.Hand;
  546. this.trackBar2.Location = new System.Drawing.Point(227, 44);
  547. this.trackBar2.Maximum = 50;
  548. this.trackBar2.Minimum = 1;
  549. this.trackBar2.Name = "trackBar2";
  550. this.trackBar2.Size = new System.Drawing.Size(71, 21);
  551. this.trackBar2.TabIndex = 26;
  552. this.trackBar2.TickStyle = System.Windows.Forms.TickStyle.None;
  553. this.trackBar2.Value = 3;
  554. this.trackBar2.Scroll += new System.EventHandler(this.trackBar2_Scroll);
  555. //
  556. // textBox2
  557. //
  558. this.textBox2.Location = new System.Drawing.Point(304, 43);
  559. this.textBox2.Name = "textBox2";
  560. this.textBox2.Size = new System.Drawing.Size(35, 21);
  561. this.textBox2.TabIndex = 25;
  562. this.textBox2.Text = "3";
  563. this.textBox2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBoxWidth_KeyPress);
  564. this.textBox2.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textBox2_KeyUp);
  565. //
  566. // label3
  567. //
  568. this.label3.AutoSize = true;
  569. this.label3.Location = new System.Drawing.Point(150, 48);
  570. this.label3.Name = "label3";
  571. this.label3.Size = new System.Drawing.Size(0, 12);
  572. this.label3.TabIndex = 24;
  573. //
  574. // label5
  575. //
  576. this.label5.AutoSize = true;
  577. this.label5.Location = new System.Drawing.Point(15, 48);
  578. this.label5.Name = "label5";
  579. this.label5.Size = new System.Drawing.Size(0, 12);
  580. this.label5.TabIndex = 23;
  581. //
  582. // panel3
  583. //
  584. this.panel3.BackColor = System.Drawing.Color.LightCoral;
  585. this.panel3.Location = new System.Drawing.Point(104, 19);
  586. this.panel3.Name = "panel3";
  587. this.panel3.Size = new System.Drawing.Size(40, 21);
  588. this.panel3.TabIndex = 22;
  589. this.panel3.Click += new System.EventHandler(this.panel6_Click);
  590. //
  591. // trackBar4
  592. //
  593. this.trackBar4.AutoSize = false;
  594. this.trackBar4.Cursor = System.Windows.Forms.Cursors.Hand;
  595. this.trackBar4.Location = new System.Drawing.Point(227, 20);
  596. this.trackBar4.Maximum = 50;
  597. this.trackBar4.Minimum = 1;
  598. this.trackBar4.Name = "trackBar4";
  599. this.trackBar4.Size = new System.Drawing.Size(71, 21);
  600. this.trackBar4.TabIndex = 7;
  601. this.trackBar4.TickStyle = System.Windows.Forms.TickStyle.None;
  602. this.trackBar4.Value = 3;
  603. this.trackBar4.Scroll += new System.EventHandler(this.trackBar4_Scroll);
  604. //
  605. // textBox10
  606. //
  607. this.textBox10.Location = new System.Drawing.Point(304, 19);
  608. this.textBox10.Name = "textBox10";
  609. this.textBox10.Size = new System.Drawing.Size(35, 21);
  610. this.textBox10.TabIndex = 6;
  611. this.textBox10.Text = "3";
  612. this.textBox10.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBoxWidth_KeyPress);
  613. this.textBox10.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textBox10_KeyUp);
  614. //
  615. // label4
  616. //
  617. this.label4.AutoSize = true;
  618. this.label4.Location = new System.Drawing.Point(150, 24);
  619. this.label4.Name = "label4";
  620. this.label4.Size = new System.Drawing.Size(0, 12);
  621. this.label4.TabIndex = 2;
  622. //
  623. // label6
  624. //
  625. this.label6.AutoSize = true;
  626. this.label6.Location = new System.Drawing.Point(15, 24);
  627. this.label6.Name = "label6";
  628. this.label6.Size = new System.Drawing.Size(0, 12);
  629. this.label6.TabIndex = 0;
  630. //
  631. // groupBox2
  632. //
  633. this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  634. | System.Windows.Forms.AnchorStyles.Right)));
  635. this.groupBox2.Controls.Add(this.panel6);
  636. this.groupBox2.Controls.Add(this.trackBar1);
  637. this.groupBox2.Controls.Add(this.textBox1);
  638. this.groupBox2.Controls.Add(this.label8);
  639. this.groupBox2.Controls.Add(this.label9);
  640. this.groupBox2.Location = new System.Drawing.Point(14, 393);
  641. this.groupBox2.Name = "groupBox2";
  642. this.groupBox2.Size = new System.Drawing.Size(353, 52);
  643. this.groupBox2.TabIndex = 22;
  644. this.groupBox2.TabStop = false;
  645. //
  646. // panel6
  647. //
  648. this.panel6.BackColor = System.Drawing.Color.Yellow;
  649. this.panel6.Location = new System.Drawing.Point(88, 18);
  650. this.panel6.Name = "panel6";
  651. this.panel6.Size = new System.Drawing.Size(45, 21);
  652. this.panel6.TabIndex = 22;
  653. this.panel6.Click += new System.EventHandler(this.panel6_Click);
  654. //
  655. // trackBar1
  656. //
  657. this.trackBar1.AutoSize = false;
  658. this.trackBar1.Cursor = System.Windows.Forms.Cursors.Hand;
  659. this.trackBar1.Location = new System.Drawing.Point(214, 20);
  660. this.trackBar1.Maximum = 50;
  661. this.trackBar1.Minimum = 1;
  662. this.trackBar1.Name = "trackBar1";
  663. this.trackBar1.Size = new System.Drawing.Size(84, 21);
  664. this.trackBar1.TabIndex = 7;
  665. this.trackBar1.TickStyle = System.Windows.Forms.TickStyle.None;
  666. this.trackBar1.Value = 3;
  667. this.trackBar1.Scroll += new System.EventHandler(this.trackBar1_Scroll);
  668. //
  669. // textBox1
  670. //
  671. this.textBox1.Location = new System.Drawing.Point(304, 19);
  672. this.textBox1.Name = "textBox1";
  673. this.textBox1.Size = new System.Drawing.Size(35, 21);
  674. this.textBox1.TabIndex = 6;
  675. this.textBox1.Text = "3";
  676. this.textBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBoxWidth_KeyPress);
  677. this.textBox1.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textBox1_KeyUp);
  678. //
  679. // label8
  680. //
  681. this.label8.AutoSize = true;
  682. this.label8.Location = new System.Drawing.Point(151, 24);
  683. this.label8.Name = "label8";
  684. this.label8.Size = new System.Drawing.Size(0, 12);
  685. this.label8.TabIndex = 2;
  686. //
  687. // label9
  688. //
  689. this.label9.AutoSize = true;
  690. this.label9.Location = new System.Drawing.Point(15, 24);
  691. this.label9.Name = "label9";
  692. this.label9.Size = new System.Drawing.Size(0, 12);
  693. this.label9.TabIndex = 0;
  694. //
  695. // groupBox4
  696. //
  697. this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  698. | System.Windows.Forms.AnchorStyles.Right)));
  699. this.groupBox4.Controls.Add(this.panel7);
  700. this.groupBox4.Controls.Add(this.textBox3);
  701. this.groupBox4.Controls.Add(this.trackBar3);
  702. this.groupBox4.Controls.Add(this.textBox5);
  703. this.groupBox4.Controls.Add(this.label10);
  704. this.groupBox4.Controls.Add(this.label16);
  705. this.groupBox4.Controls.Add(this.label18);
  706. this.groupBox4.Location = new System.Drawing.Point(14, 117);
  707. this.groupBox4.Name = "groupBox4";
  708. this.groupBox4.Size = new System.Drawing.Size(353, 79);
  709. this.groupBox4.TabIndex = 23;
  710. this.groupBox4.TabStop = false;
  711. //
  712. // panel7
  713. //
  714. this.panel7.BackColor = System.Drawing.Color.Red;
  715. this.panel7.Location = new System.Drawing.Point(88, 19);
  716. this.panel7.Name = "panel7";
  717. this.panel7.Size = new System.Drawing.Size(45, 21);
  718. this.panel7.TabIndex = 23;
  719. this.panel7.Click += new System.EventHandler(this.panel6_Click);
  720. //
  721. // textBox3
  722. //
  723. this.textBox3.Location = new System.Drawing.Point(134, 47);
  724. this.textBox3.Name = "textBox3";
  725. this.textBox3.Size = new System.Drawing.Size(121, 21);
  726. this.textBox3.TabIndex = 8;
  727. this.textBox3.Text = "25";
  728. this.textBox3.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBoxWidth_KeyPress);
  729. this.textBox3.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textBox3_KeyUp);
  730. //
  731. // trackBar3
  732. //
  733. this.trackBar3.AutoSize = false;
  734. this.trackBar3.Cursor = System.Windows.Forms.Cursors.Hand;
  735. this.trackBar3.Location = new System.Drawing.Point(214, 20);
  736. this.trackBar3.Maximum = 50;
  737. this.trackBar3.Minimum = 1;
  738. this.trackBar3.Name = "trackBar3";
  739. this.trackBar3.Size = new System.Drawing.Size(84, 21);
  740. this.trackBar3.TabIndex = 7;
  741. this.trackBar3.TickStyle = System.Windows.Forms.TickStyle.None;
  742. this.trackBar3.Value = 3;
  743. this.trackBar3.Scroll += new System.EventHandler(this.trackBar3_Scroll);
  744. //
  745. // textBox5
  746. //
  747. this.textBox5.Location = new System.Drawing.Point(304, 19);
  748. this.textBox5.Name = "textBox5";
  749. this.textBox5.Size = new System.Drawing.Size(35, 21);
  750. this.textBox5.TabIndex = 6;
  751. this.textBox5.Text = "3";
  752. this.textBox5.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBoxWidth_KeyPress);
  753. this.textBox5.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textBox5_KeyUp);
  754. //
  755. // label10
  756. //
  757. this.label10.AutoSize = true;
  758. this.label10.Location = new System.Drawing.Point(15, 51);
  759. this.label10.Name = "label10";
  760. this.label10.Size = new System.Drawing.Size(0, 12);
  761. this.label10.TabIndex = 3;
  762. //
  763. // label16
  764. //
  765. this.label16.AutoSize = true;
  766. this.label16.Location = new System.Drawing.Point(139, 24);
  767. this.label16.Name = "label16";
  768. this.label16.Size = new System.Drawing.Size(0, 12);
  769. this.label16.TabIndex = 2;
  770. //
  771. // label18
  772. //
  773. this.label18.AutoSize = true;
  774. this.label18.Location = new System.Drawing.Point(15, 24);
  775. this.label18.Name = "label18";
  776. this.label18.Size = new System.Drawing.Size(0, 12);
  777. this.label18.TabIndex = 0;
  778. //
  779. // groupBox7
  780. //
  781. this.groupBox7.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  782. | System.Windows.Forms.AnchorStyles.Right)));
  783. this.groupBox7.Controls.Add(this.panel4);
  784. this.groupBox7.Controls.Add(this.trackBar7);
  785. this.groupBox7.Controls.Add(this.textBox9);
  786. this.groupBox7.Controls.Add(this.label1);
  787. this.groupBox7.Controls.Add(this.label2);
  788. this.groupBox7.Location = new System.Drawing.Point(14, 331);
  789. this.groupBox7.Name = "groupBox7";
  790. this.groupBox7.Size = new System.Drawing.Size(353, 56);
  791. this.groupBox7.TabIndex = 24;
  792. this.groupBox7.TabStop = false;
  793. //
  794. // panel4
  795. //
  796. this.panel4.BackColor = System.Drawing.Color.ForestGreen;
  797. this.panel4.Location = new System.Drawing.Point(104, 19);
  798. this.panel4.Name = "panel4";
  799. this.panel4.Size = new System.Drawing.Size(40, 21);
  800. this.panel4.TabIndex = 23;
  801. this.panel4.Click += new System.EventHandler(this.panel6_Click);
  802. //
  803. // trackBar7
  804. //
  805. this.trackBar7.AutoSize = false;
  806. this.trackBar7.Cursor = System.Windows.Forms.Cursors.Hand;
  807. this.trackBar7.Location = new System.Drawing.Point(227, 20);
  808. this.trackBar7.Maximum = 50;
  809. this.trackBar7.Minimum = 1;
  810. this.trackBar7.Name = "trackBar7";
  811. this.trackBar7.Size = new System.Drawing.Size(71, 21);
  812. this.trackBar7.TabIndex = 7;
  813. this.trackBar7.TickStyle = System.Windows.Forms.TickStyle.None;
  814. this.trackBar7.Value = 3;
  815. this.trackBar7.Scroll += new System.EventHandler(this.trackBar7_Scroll);
  816. //
  817. // textBox9
  818. //
  819. this.textBox9.Location = new System.Drawing.Point(304, 19);
  820. this.textBox9.Name = "textBox9";
  821. this.textBox9.Size = new System.Drawing.Size(35, 21);
  822. this.textBox9.TabIndex = 6;
  823. this.textBox9.Text = "3";
  824. this.textBox9.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBoxWidth_KeyPress);
  825. this.textBox9.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textBox9_KeyUp);
  826. //
  827. // label1
  828. //
  829. this.label1.AutoSize = true;
  830. this.label1.Location = new System.Drawing.Point(150, 24);
  831. this.label1.Name = "label1";
  832. this.label1.Size = new System.Drawing.Size(0, 12);
  833. this.label1.TabIndex = 2;
  834. //
  835. // label2
  836. //
  837. this.label2.AutoSize = true;
  838. this.label2.Location = new System.Drawing.Point(15, 24);
  839. this.label2.Name = "label2";
  840. this.label2.Size = new System.Drawing.Size(0, 12);
  841. this.label2.TabIndex = 0;
  842. //
  843. // groupBox5
  844. //
  845. this.groupBox5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  846. | System.Windows.Forms.AnchorStyles.Right)));
  847. this.groupBox5.Controls.Add(this.panel2);
  848. this.groupBox5.Controls.Add(this.trackBar8);
  849. this.groupBox5.Controls.Add(this.textBox7);
  850. this.groupBox5.Controls.Add(this.label7);
  851. this.groupBox5.Controls.Add(this.label15);
  852. this.groupBox5.Location = new System.Drawing.Point(14, 59);
  853. this.groupBox5.Name = "groupBox5";
  854. this.groupBox5.Size = new System.Drawing.Size(353, 52);
  855. this.groupBox5.TabIndex = 23;
  856. this.groupBox5.TabStop = false;
  857. //
  858. // panel2
  859. //
  860. this.panel2.BackColor = System.Drawing.Color.IndianRed;
  861. this.panel2.Location = new System.Drawing.Point(88, 18);
  862. this.panel2.Name = "panel2";
  863. this.panel2.Size = new System.Drawing.Size(45, 21);
  864. this.panel2.TabIndex = 22;
  865. this.panel2.Click += new System.EventHandler(this.panel6_Click);
  866. //
  867. // trackBar8
  868. //
  869. this.trackBar8.AutoSize = false;
  870. this.trackBar8.Cursor = System.Windows.Forms.Cursors.Hand;
  871. this.trackBar8.Location = new System.Drawing.Point(214, 20);
  872. this.trackBar8.Maximum = 50;
  873. this.trackBar8.Minimum = 1;
  874. this.trackBar8.Name = "trackBar8";
  875. this.trackBar8.Size = new System.Drawing.Size(84, 21);
  876. this.trackBar8.TabIndex = 7;
  877. this.trackBar8.TickStyle = System.Windows.Forms.TickStyle.None;
  878. this.trackBar8.Value = 3;
  879. this.trackBar8.Scroll += new System.EventHandler(this.trackBar8_Scroll);
  880. //
  881. // textBox7
  882. //
  883. this.textBox7.Location = new System.Drawing.Point(304, 19);
  884. this.textBox7.Name = "textBox7";
  885. this.textBox7.Size = new System.Drawing.Size(35, 21);
  886. this.textBox7.TabIndex = 6;
  887. this.textBox7.Text = "3";
  888. this.textBox7.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBoxWidth_KeyPress);
  889. this.textBox7.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textBox7_KeyUp);
  890. //
  891. // label7
  892. //
  893. this.label7.AutoSize = true;
  894. this.label7.Location = new System.Drawing.Point(151, 24);
  895. this.label7.Name = "label7";
  896. this.label7.Size = new System.Drawing.Size(0, 12);
  897. this.label7.TabIndex = 2;
  898. //
  899. // label15
  900. //
  901. this.label15.AutoSize = true;
  902. this.label15.Location = new System.Drawing.Point(15, 24);
  903. this.label15.Name = "label15";
  904. this.label15.Size = new System.Drawing.Size(0, 12);
  905. this.label15.TabIndex = 0;
  906. //
  907. // TABMethod4DialogSetting
  908. //
  909. this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
  910. this.ClientSize = new System.Drawing.Size(874, 457);
  911. this.Controls.Add(this.groupBox5);
  912. this.Controls.Add(this.groupBox7);
  913. this.Controls.Add(this.groupBox4);
  914. this.Controls.Add(this.groupBox2);
  915. this.Controls.Add(this.groupBox6);
  916. this.Controls.Add(this.groupBox3);
  917. this.Controls.Add(this.groupBox1);
  918. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
  919. this.MaximizeBox = false;
  920. this.MinimizeBox = false;
  921. this.Name = "TABMethod4DialogSetting";
  922. this.Controls.SetChildIndex(this.groupBox1, 0);
  923. this.Controls.SetChildIndex(this.groupBox3, 0);
  924. this.Controls.SetChildIndex(this.groupBox6, 0);
  925. this.Controls.SetChildIndex(this.groupBox2, 0);
  926. this.Controls.SetChildIndex(this.groupBox4, 0);
  927. this.Controls.SetChildIndex(this.groupBox7, 0);
  928. this.Controls.SetChildIndex(this.groupBox5, 0);
  929. this.groupBox1.ResumeLayout(false);
  930. this.groupBox6.ResumeLayout(false);
  931. this.groupBox6.PerformLayout();
  932. ((System.ComponentModel.ISupportInitialize)(this.trackBar6)).EndInit();
  933. ((System.ComponentModel.ISupportInitialize)(this.trackBar5)).EndInit();
  934. ((System.ComponentModel.ISupportInitialize)(this.trackBar2)).EndInit();
  935. ((System.ComponentModel.ISupportInitialize)(this.trackBar4)).EndInit();
  936. this.groupBox2.ResumeLayout(false);
  937. this.groupBox2.PerformLayout();
  938. ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit();
  939. this.groupBox4.ResumeLayout(false);
  940. this.groupBox4.PerformLayout();
  941. ((System.ComponentModel.ISupportInitialize)(this.trackBar3)).EndInit();
  942. this.groupBox7.ResumeLayout(false);
  943. this.groupBox7.PerformLayout();
  944. ((System.ComponentModel.ISupportInitialize)(this.trackBar7)).EndInit();
  945. this.groupBox5.ResumeLayout(false);
  946. this.groupBox5.PerformLayout();
  947. ((System.ComponentModel.ISupportInitialize)(this.trackBar8)).EndInit();
  948. this.ResumeLayout(false);
  949. }
  950. /// <summary>
  951. /// 初始化其他控件
  952. /// </summary>
  953. private void InitOtherTools()
  954. {
  955. //
  956. //初始化图像控件
  957. //
  958. this.documentWorkspace = new DocumentWorkspaceWindow(this.appWorkspace);
  959. this.documentWorkspace.Dock = DockStyle.Fill;
  960. this.documentWorkspace.HookMouseEvents();
  961. this.documentWorkspace.AuxiliaryLineEnabled = false;
  962. this.documentWorkspace.Visible = false;
  963. this.documentWorkspace.activeTool = Annotation.Enum.DrawToolType.NullTool;
  964. this.groupBox3.Controls.Add(documentWorkspace);
  965. //
  966. //初始化操作按钮
  967. //
  968. this.commonControlButtons = new CommonControlButtons();
  969. this.commonControlButtons.Dock = DockStyle.Top;
  970. this.commonControlButtons.Height = 30;
  971. this.commonControlButtons.HideZoomToWindowAndActualSize();
  972. this.groupBox3.Controls.Add(commonControlButtons);
  973. //
  974. //调色板
  975. //
  976. this.colorsForm1 = new ColorsForm();
  977. this.colorsForm1.StartPosition = FormStartPosition.CenterScreen;
  978. this.colorsForm1.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
  979. this.colorsForm2 = new ColorsForm();
  980. this.colorsForm2.StartPosition = FormStartPosition.CenterScreen;
  981. this.colorsForm2.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
  982. this.colorsForm3 = new ColorsForm();
  983. this.colorsForm3.StartPosition = FormStartPosition.CenterScreen;
  984. this.colorsForm3.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
  985. this.colorsForm4 = new ColorsForm();
  986. this.colorsForm4.StartPosition = FormStartPosition.CenterScreen;
  987. this.colorsForm4.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
  988. this.colorsForm5 = new ColorsForm();
  989. this.colorsForm5.StartPosition = FormStartPosition.CenterScreen;
  990. this.colorsForm5.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
  991. ////
  992. ////滚动条与输入框值匹配
  993. ////
  994. //this.textBox1.Text = "" + this.trackBar1.Value;
  995. //this.textBox2.Text = "" + this.trackBar2.Value;
  996. }
  997. /// <summary>
  998. /// 初始化画布按键功能
  999. /// </summary>
  1000. private void InitCommonButtonEvent()
  1001. {
  1002. this.commonControlButtons.zoomInButton.Click += new EventHandler(zoomInButton_Click);
  1003. this.commonControlButtons.zoomOutButton.Click += new EventHandler(zoomOutButton_Click);
  1004. this.commonControlButtons.zoomToWindowButton.Click += new EventHandler(zoomToWindowButton_Click);
  1005. this.commonControlButtons.actualSizeButton.Click += new EventHandler(actualSizeButton_Click);
  1006. this.commonControlButtons.pointerButton.Click += new EventHandler(pointerButton_Click);
  1007. this.commonControlButtons.mobileModeButton.Click += new EventHandler(mobileModeButton_Click);
  1008. }
  1009. private void zoomInButton_Click(object sender, EventArgs e)
  1010. {
  1011. this.documentWorkspace.ZoomIn();
  1012. }
  1013. private void zoomOutButton_Click(object sender, EventArgs e)
  1014. {
  1015. this.documentWorkspace.ZoomOut();
  1016. }
  1017. private void zoomToWindowButton_Click(object sender, EventArgs e)
  1018. {
  1019. this.documentWorkspace.ZoomBasis = ZoomBasis.FitToWindow;
  1020. }
  1021. private void actualSizeButton_Click(object sender, EventArgs e)
  1022. {
  1023. this.documentWorkspace.ZoomBasis = ZoomBasis.ScaleFactor;
  1024. this.documentWorkspace.ScaleFactor = ScaleFactor.OneToOne;
  1025. }
  1026. private void pointerButton_Click(object sender, EventArgs e)
  1027. {
  1028. this.documentWorkspace.ActiveTool = Annotation.Enum.DrawToolType.Pointer;
  1029. }
  1030. private void mobileModeButton_Click(object sender, EventArgs e)
  1031. {
  1032. this.documentWorkspace.ActiveTool = Annotation.Enum.DrawToolType.MoveMode;
  1033. }
  1034. /// <summary>
  1035. /// 添加画布绑定事件
  1036. /// </summary>
  1037. private void AddPictureBoxEvent()
  1038. {
  1039. this.documentWorkspace.panel.MouseDown += new MouseEventHandler(this.BoxMouseDownHandler);
  1040. this.documentWorkspace.panel.MouseMove += new MouseEventHandler(this.BoxMouseMoveHandler);
  1041. this.documentWorkspace.panel.MouseUp += new MouseEventHandler(this.BoxMouseUpHandler);
  1042. this.documentWorkspace.panel.Paint += new PaintEventHandler(this.BoxPaintHandler);
  1043. }
  1044. /// <summary>
  1045. /// 调色板回调函数
  1046. /// </summary>
  1047. /// <param name="sender"></param>
  1048. /// <param name="ce"></param>
  1049. private void colorsFormUserPrimaryColorChanged(object sender, ColorEventArgs ce)
  1050. {
  1051. }
  1052. /// <summary>
  1053. /// 添加内容单元格
  1054. /// </summary>
  1055. /// <param name="text"></param>
  1056. /// <param name="tag"></param>
  1057. /// <returns></returns>
  1058. private DataGridViewTextBoxCell CreateTextBoxCell(string text, object tag)
  1059. {
  1060. DataGridViewTextBoxCell textboxcell = new DataGridViewTextBoxCell();
  1061. textboxcell.Value = text;
  1062. textboxcell.Tag = tag;
  1063. return textboxcell;
  1064. }
  1065. /// <summary>
  1066. /// 设置按钮
  1067. /// </summary>
  1068. /// <param name="sender"></param>
  1069. /// <param name="e"></param>
  1070. private void button1_Click(object sender, EventArgs e)
  1071. {
  1072. AnalyzeSettingDialog metallographicMethodSetDialog = new AnalyzeSettingDialog(this, "Template.Manager.item3.MetallographicMethod");
  1073. if (metallographicMethodSetDialog.hasModule)
  1074. {
  1075. metallographicMethodSetDialog.StartPosition = FormStartPosition.CenterScreen;
  1076. metallographicMethodSetDialog.ShowDialog();
  1077. }
  1078. else
  1079. {
  1080. metallographicMethodSetDialog = null;
  1081. }
  1082. }
  1083. /// <summary>
  1084. /// 保存按钮
  1085. /// </summary>
  1086. /// <param name="sender"></param>
  1087. /// <param name="e"></param>
  1088. private void button2_Click(object sender, EventArgs e)
  1089. {
  1090. this.parentDialog.rectLineWidth = this.trackBar8.Value;
  1091. this.parentDialog.baseLineWidth = this.trackBar1.Value;
  1092. this.parentDialog.scopeLineWidth = this.trackBar3.Value;
  1093. this.parentDialog.orgLineWidth = this.trackBar4.Value;
  1094. this.parentDialog.rect1LineWidth = this.trackBar2.Value;
  1095. this.parentDialog.rect2LineWidth = this.trackBar5.Value;
  1096. this.parentDialog.rect3LineWidth = this.trackBar6.Value;
  1097. this.parentDialog.assistLineWidth = this.trackBar7.Value;
  1098. int res = this.parentDialog.scopeMarginLeft;
  1099. if (int.TryParse(this.textBox3.Text, out res))
  1100. this.parentDialog.scopeMarginLeft = res;
  1101. this.parentDialog.rectLineColor = this.panel2.BackColor;
  1102. this.parentDialog.baseLineColor = this.panel6.BackColor;
  1103. this.parentDialog.scopeLineColor = this.panel7.BackColor;
  1104. this.parentDialog.orgLineColor = this.panel3.BackColor;
  1105. this.parentDialog.rect1LineColor = this.panel1.BackColor;
  1106. this.parentDialog.rect2LineColor = this.panel8.BackColor;
  1107. this.parentDialog.rect3LineColor = this.panel9.BackColor;
  1108. this.parentDialog.assistLineColor = this.panel4.BackColor;
  1109. this.parentDialog.refreshWorkSpace();
  1110. this.Close();
  1111. }
  1112. ///// <summary>
  1113. ///// 限制只可以输入0-9数字以及退格键
  1114. ///// </summary>
  1115. ///// <param name="sender"></param>
  1116. ///// <param name="e"></param>
  1117. //private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
  1118. //{
  1119. // if (e.KeyChar != '\b')//这是允许输入退格键 
  1120.         //    {
  1121. // int len = this.textBox1.Text.Length;
  1122. // if (len < 1 && e.KeyChar == '0')
  1123. // {
  1124. // e.Handled = true;
  1125. // }
  1126. // else if ((e.KeyChar < '0') || (e.KeyChar > '9'))//这是允许输入0-9数字 
  1127.         //        {
  1128. // e.Handled = true;
  1129. // }
  1130. // }
  1131. //}
  1132. ///// <summary>
  1133. ///// 对输入值做限制
  1134. ///// </summary>
  1135. ///// <param name="sender"></param>
  1136. ///// <param name="e"></param>
  1137. //private void textBox1_KeyUp(object sender, KeyEventArgs e)
  1138. //{
  1139. // if (string.IsNullOrEmpty(this.textBox1.Text))
  1140. // this.textBox1.Text = "1";
  1141. // if (Convert.ToInt32(this.textBox1.Text) > 50)
  1142. // this.textBox1.Text = "50";
  1143. // this.trackBar1.Value = Convert.ToInt32(this.textBox1.Text);
  1144. ////}
  1145. ///// <summary>
  1146. ///// 限制只可以输入0-9数字以及退格键
  1147. ///// </summary>
  1148. ///// <param name="sender"></param>
  1149. ///// <param name="e"></param>
  1150. //private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
  1151. //{
  1152. // if (e.KeyChar != '\b')//这是允许输入退格键 
  1153.         //    {
  1154. // int len = this.textBox1.Text.Length;
  1155. // if (len < 1 && e.KeyChar == '0')
  1156. // {
  1157. // e.Handled = true;
  1158. // }
  1159. // else if ((e.KeyChar < '0') || (e.KeyChar > '9'))//这是允许输入0-9数字 
  1160.         //        {
  1161. // e.Handled = true;
  1162. // }
  1163. // }
  1164. //}
  1165. ///// <summary>
  1166. ///// 对输入值做限制
  1167. ///// </summary>
  1168. ///// <param name="sender"></param>
  1169. ///// <param name="e"></param>
  1170. //private void textBox2_KeyUp(object sender, KeyEventArgs e)
  1171. //{
  1172. // if (string.IsNullOrEmpty(this.textBox2.Text))
  1173. // this.textBox2.Text = "1";
  1174. // if (Convert.ToInt32(this.textBox2.Text) > 50)
  1175. // this.textBox2.Text = "50";
  1176. // this.trackBar2.Value = Convert.ToInt32(this.textBox2.Text);
  1177. //}
  1178. ///// <summary>
  1179. ///// 基准线panel被点击
  1180. ///// </summary>
  1181. ///// <param name="sender"></param>
  1182. ///// <param name="e"></param>
  1183. //private void panel1_Click(object sender, EventArgs e)
  1184. //{
  1185. // this.colorsForm1.UserPrimaryColor = ColorBgra.FromColor(this.panel1.BackColor);
  1186. // this.colorsForm1.setSaveBtn_Click(new System.EventHandler(this.colorsForm1Changed));
  1187. // this.colorsForm1.ShowDialog();
  1188. //}
  1189. //private void colorsForm1Changed(object sender, EventArgs e)
  1190. //{
  1191. // this.panel1.BackColor = this.colorsForm1.UserPrimaryColor.ToColor();
  1192. // this.colorsForm1.Close();
  1193. // this.documentWorkspace.Refresh();
  1194. //}
  1195. ///// <summary>
  1196. ///// 线长滚动条滚动事件
  1197. ///// </summary>
  1198. ///// <param name="sender"></param>
  1199. ///// <param name="e"></param>
  1200. //private void trackBar1_Scroll(object sender, EventArgs e)
  1201. //{
  1202. // this.textBox1.Text = "" + this.trackBar1.Value;
  1203. //}
  1204. //private void trackBar1_ValueChanged(object sender, EventArgs e)
  1205. //{
  1206. // this.documentWorkspace.Refresh();
  1207. //}
  1208. ///// <summary>
  1209. ///// 线宽滚动条滚动事件
  1210. ///// </summary>
  1211. ///// <param name="sender"></param>
  1212. ///// <param name="e"></param>
  1213. //private void trackBar2_Scroll(object sender, EventArgs e)
  1214. //{
  1215. // this.textBox2.Text = "" + this.trackBar2.Value;
  1216. //}
  1217. //private void trackBar2_ValueChanged(object sender, EventArgs e)
  1218. //{
  1219. // this.documentWorkspace.Refresh();
  1220. //}
  1221. ///// <summary>
  1222. ///// 完全脱碳层选择框选中事件
  1223. ///// </summary>
  1224. ///// <param name="sender"></param>
  1225. ///// <param name="e"></param>
  1226. //private void checkBox2_CheckedChanged(object sender, EventArgs e)
  1227. //{
  1228. // if(this.pointList.Count > 0)
  1229. // {
  1230. // if (this.checkBox2.Checked && this.checkBox3.Checked)
  1231. // {
  1232. // foreach(PointF[] pf in pointList)
  1233. // {
  1234. // pf[2] = new PointF((pf[0].X + pf[3].X) / 2f, (pf[0].Y + pf[3].Y) / 2f);
  1235. // }
  1236. // }
  1237. // if (this.checkBox2.Checked && !this.checkBox3.Checked)
  1238. // {
  1239. // foreach (PointF[] pf in pointList)
  1240. // {
  1241. // pf[2] = new PointF((pf[0].X + pf[1].X) / 2f, (pf[0].Y + pf[1].Y) / 2f);
  1242. // }
  1243. // }
  1244. // if (!this.checkBox2.Checked)
  1245. // {
  1246. // foreach (PointF[] pf in pointList)
  1247. // {
  1248. // pf[2] = PointF.Empty;
  1249. // }
  1250. // }
  1251. // RefreshDataGridView1();
  1252. // this.documentWorkspace.Refresh();
  1253. // }
  1254. //}
  1255. ///// <summary>
  1256. ///// 有效脱碳层选择框选中事件
  1257. ///// </summary>
  1258. ///// <param name="sender"></param>
  1259. ///// <param name="e"></param>
  1260. //private void checkBox3_CheckedChanged(object sender, EventArgs e)
  1261. //{
  1262. // if (this.pointList.Count > 0)
  1263. // {
  1264. // if (this.checkBox3.Checked && this.checkBox2.Checked)
  1265. // {
  1266. // foreach (PointF[] pf in pointList)
  1267. // {
  1268. // pf[3] = new PointF((pf[2].X + pf[1].X) / 2f, (pf[2].Y + pf[1].Y) / 2f);
  1269. // }
  1270. // }
  1271. // if (this.checkBox3.Checked && !this.checkBox2.Checked)
  1272. // {
  1273. // foreach (PointF[] pf in pointList)
  1274. // {
  1275. // pf[3] = new PointF((pf[0].X + pf[1].X) / 2f, (pf[0].Y + pf[1].Y) / 2f);
  1276. // }
  1277. // }
  1278. // if (!this.checkBox3.Checked)
  1279. // {
  1280. // foreach (PointF[] pf in pointList)
  1281. // {
  1282. // pf[3] = PointF.Empty;
  1283. // }
  1284. // }
  1285. // RefreshDataGridView1();
  1286. // this.documentWorkspace.Refresh();
  1287. // }
  1288. //}
  1289. /// <summary>
  1290. /// 鼠标按下
  1291. /// </summary>
  1292. /// <param name="sender"></param>
  1293. /// <param name="e"></param>
  1294. private void BoxMouseDownHandler(object sender, MouseEventArgs e)
  1295. {
  1296. if (operationK >= 0 && e.Button == MouseButtons.Left)
  1297. {
  1298. PointF downPoint = this.documentWorkspace.GetScalePoint(e.Location);
  1299. if (operationK == 0)
  1300. {
  1301. startPoint = endPoint = downPoint;
  1302. nowLine = new PointF[4];
  1303. nowLine[0] = startPoint;
  1304. nowLine[1] = endPoint;
  1305. pointList.Add(nowLine);
  1306. }
  1307. else if (operationK == 1)
  1308. {
  1309. lastPoint.X = downPoint.X;
  1310. lastPoint.Y = downPoint.Y;
  1311. tempPoint.X = downPoint.X;
  1312. tempPoint.Y = downPoint.Y;
  1313. for (int i = rectangleFList.Count - 1; i >= 0; i--)
  1314. {
  1315. if (rectangleFList[i].Contains(downPoint))
  1316. {
  1317. selected = i;
  1318. canMove = true;
  1319. }
  1320. }
  1321. if(selected > -1)
  1322. {
  1323. if (new RectangleF(pointList[selected][0].X - 3, pointList[selected][0].Y - 3, 7, 7).Contains(downPoint))
  1324. movePointIndex = 0;
  1325. else if (new RectangleF(pointList[selected][1].X - 3, pointList[selected][1].Y - 3, 7, 7).Contains(downPoint))
  1326. movePointIndex = 1;
  1327. else if (pointList[selected][2] != PointF.Empty && new RectangleF(pointList[selected][2].X - 3, pointList[selected][2].Y - 3, 7, 7).Contains(downPoint))
  1328. movePointIndex = 2;
  1329. else if (pointList[selected][3] != PointF.Empty && new RectangleF(pointList[selected][3].X - 3, pointList[selected][3].Y - 3, 7, 7).Contains(downPoint))
  1330. movePointIndex = 3;
  1331. else
  1332. movePointIndex = -1;
  1333. }
  1334. if (canMove)
  1335. return;
  1336. selected = -1;
  1337. }
  1338. }
  1339. }
  1340. /// <summary>
  1341. /// 鼠标移动
  1342. /// </summary>
  1343. /// <param name="sender"></param>
  1344. /// <param name="e"></param>
  1345. private void BoxMouseMoveHandler(object sender, MouseEventArgs e)
  1346. {
  1347. this.documentWorkspace.panel.Cursor = Cursors.Default;
  1348. if (operationK >= 0 && e.Button == MouseButtons.Left)
  1349. {
  1350. PointF movePoint = this.documentWorkspace.GetScalePoint(e.Location);
  1351. //if (operationK == 0)
  1352. //{
  1353. // this.endPoint = movePoint;
  1354. // pointList[lineCount][1] = endPoint;
  1355. //}
  1356. //else if (operationK == 1 && selected > -1 && canMove)
  1357. //{
  1358. // float dx = movePoint.X - lastPoint.X;
  1359. // float dy = movePoint.Y - lastPoint.Y;
  1360. // float dxTemp = movePoint.X - tempPoint.X;
  1361. // float dyTemp = movePoint.Y - tempPoint.Y;
  1362. // lastPoint.X = movePoint.X;
  1363. // lastPoint.Y = movePoint.Y;
  1364. // if (movePointIndex == -1)
  1365. // {
  1366. // RectangleF rectangleF = new RectangleF();
  1367. // rectangleF = rectangleFList[selected];
  1368. // if (rectangleF.Contains(movePoint))
  1369. // this.documentWorkspace.panel.Cursor = Cursors.SizeAll;
  1370. // rectangleF.X += dx;
  1371. // rectangleF.Y += dy;
  1372. // rectangleFList[selected] = rectangleF;
  1373. // for (int i = 0; i < pointList[selected].Count(); i++)
  1374. // {
  1375. // pointList[selected][i].X += dx;
  1376. // pointList[selected][i].Y += dy;
  1377. // }
  1378. // }
  1379. // else if (movePointIndex == 0)
  1380. // {
  1381. // pointList[selected][0].X += dx;
  1382. // pointList[selected][0].Y += dy;
  1383. // if (checkBox2.Checked && checkBox3.Checked)
  1384. // {
  1385. // pointList[selected][2] = new PointF((2 * pointList[selected][0].X + pointList[selected][1].X) / 3f,
  1386. // (2 * pointList[selected][0].Y + pointList[selected][1].Y) / 3f);
  1387. // pointList[selected][3] = new PointF((pointList[selected][0].X + 2 * pointList[selected][1].X) / 3f,
  1388. // (pointList[selected][0].Y + 2 * pointList[selected][1].Y) / 3f);
  1389. // }
  1390. // else if (checkBox2.Checked && !checkBox3.Checked)
  1391. // {
  1392. // pointList[selected][2] = new PointF((pointList[selected][0].X + pointList[selected][1].X) / 2f,
  1393. // (pointList[selected][0].Y + pointList[selected][1].Y) / 2f);
  1394. // pointList[selected][3] = PointF.Empty;
  1395. // }
  1396. // else if (!checkBox2.Checked && checkBox3.Checked)
  1397. // {
  1398. // pointList[selected][3] = new PointF((pointList[selected][0].X + pointList[selected][1].X) / 2f,
  1399. // (pointList[selected][0].Y + pointList[selected][1].Y) / 2f);
  1400. // pointList[selected][2] = PointF.Empty;
  1401. // }
  1402. // else
  1403. // {
  1404. // pointList[selected][2] = PointF.Empty;
  1405. // pointList[selected][3] = PointF.Empty;
  1406. // }
  1407. // rectangleFList[selected] = CalcOtherRectangle(pointList[selected][0], pointList[selected][1]);
  1408. // }
  1409. // else if (movePointIndex == 1)
  1410. // {
  1411. // pointList[selected][1].X += dx;
  1412. // pointList[selected][1].Y += dy;
  1413. // if (checkBox2.Checked && checkBox3.Checked)
  1414. // {
  1415. // pointList[selected][2] = new PointF((2 * pointList[selected][0].X + pointList[selected][1].X) / 3f,
  1416. // (2 * pointList[selected][0].Y + pointList[selected][1].Y) / 3f);
  1417. // pointList[selected][3] = new PointF((pointList[selected][0].X + 2 * pointList[selected][1].X) / 3f,
  1418. // (pointList[selected][0].Y + 2 * pointList[selected][1].Y) / 3f);
  1419. // }
  1420. // else if (checkBox2.Checked && !checkBox3.Checked)
  1421. // {
  1422. // pointList[selected][2] = new PointF((pointList[selected][0].X + pointList[selected][1].X) / 2f,
  1423. // (pointList[selected][0].Y + pointList[selected][1].Y) / 2f);
  1424. // pointList[selected][3] = PointF.Empty;
  1425. // }
  1426. // else if (!checkBox2.Checked && checkBox3.Checked)
  1427. // {
  1428. // pointList[selected][3] = new PointF((pointList[selected][0].X + pointList[selected][1].X) / 2f,
  1429. // (pointList[selected][0].Y + pointList[selected][1].Y) / 2f);
  1430. // pointList[selected][2] = PointF.Empty;
  1431. // }
  1432. // else
  1433. // {
  1434. // pointList[selected][2] = PointF.Empty;
  1435. // pointList[selected][3] = PointF.Empty;
  1436. // }
  1437. // rectangleFList[selected] = CalcOtherRectangle(pointList[selected][0], pointList[selected][1]);
  1438. // }
  1439. // else if (movePointIndex == 2)
  1440. // {
  1441. // //测量线是一条垂线
  1442. // if (pointList[selected][0].X == pointList[selected][1].X)
  1443. // {
  1444. // pointList[selected][2].Y += dy;
  1445. // if (pointList[selected][3] == PointF.Empty)
  1446. // pointList[selected][2].Y = FormatCoordinate(pointList[selected][0].Y, pointList[selected][1].Y, pointList[selected][2].Y);
  1447. // else
  1448. // pointList[selected][2].Y = FormatCoordinate(pointList[selected][0].Y, pointList[selected][3].Y, pointList[selected][2].Y);
  1449. // }
  1450. // //测量线是一条平行线
  1451. // else if (pointList[selected][0].Y == pointList[selected][1].Y)
  1452. // {
  1453. // pointList[selected][2].X += dx;
  1454. // if (pointList[selected][3] == PointF.Empty)
  1455. // pointList[selected][2].X = FormatCoordinate(pointList[selected][0].X, pointList[selected][1].X, pointList[selected][2].X);
  1456. // else
  1457. // pointList[selected][2].X = FormatCoordinate(pointList[selected][0].X, pointList[selected][3].X, pointList[selected][2].X);
  1458. // }
  1459. // //其他情况
  1460. // else
  1461. // {
  1462. // float k = (pointList[selected][1].Y - pointList[selected][0].Y) / (pointList[selected][1].X - pointList[selected][0].X);
  1463. // float b = pointList[selected][0].Y - k * pointList[selected][0].X;
  1464. // if (Math.Abs(dxTemp) >= Math.Abs(dyTemp))
  1465. // {
  1466. // pointList[selected][2].X += dx;
  1467. // if (pointList[selected][3] == PointF.Empty)
  1468. // pointList[selected][2].X = FormatCoordinate(pointList[selected][0].X, pointList[selected][1].X, pointList[selected][2].X);
  1469. // else
  1470. // pointList[selected][2].X = FormatCoordinate(pointList[selected][0].X, pointList[selected][3].X, pointList[selected][2].X);
  1471. // pointList[selected][2].Y = k * pointList[selected][2].X + b;
  1472. // }
  1473. // else
  1474. // {
  1475. // pointList[selected][2].Y += dy;
  1476. // if (pointList[selected][3] == PointF.Empty)
  1477. // pointList[selected][2].Y = FormatCoordinate(pointList[selected][0].Y, pointList[selected][1].Y, pointList[selected][2].Y);
  1478. // else
  1479. // pointList[selected][2].Y = FormatCoordinate(pointList[selected][0].Y, pointList[selected][3].Y, pointList[selected][2].Y);
  1480. // pointList[selected][2].X = (pointList[selected][2].Y - b) / k;
  1481. // }
  1482. // }
  1483. // }
  1484. // else if (movePointIndex == 3)
  1485. // {
  1486. // //测量线是一条垂线
  1487. // if (pointList[selected][0].X == pointList[selected][1].X)
  1488. // {
  1489. // pointList[selected][3].Y += dy;
  1490. // if (pointList[selected][2] == PointF.Empty)
  1491. // pointList[selected][3].Y = FormatCoordinate(pointList[selected][0].Y, pointList[selected][1].Y, pointList[selected][3].Y);
  1492. // else
  1493. // pointList[selected][3].Y = FormatCoordinate(pointList[selected][2].Y, pointList[selected][1].Y, pointList[selected][3].Y);
  1494. // }
  1495. // //测量线是一条平行线
  1496. // else if (pointList[selected][0].Y == pointList[selected][1].Y)
  1497. // {
  1498. // pointList[selected][3].X += dx;
  1499. // if (pointList[selected][2] == PointF.Empty)
  1500. // pointList[selected][3].X = FormatCoordinate(pointList[selected][0].X, pointList[selected][1].X, pointList[selected][3].X);
  1501. // else
  1502. // pointList[selected][3].X = FormatCoordinate(pointList[selected][2].X, pointList[selected][1].X, pointList[selected][3].X);
  1503. // }
  1504. // //其他情况
  1505. // else
  1506. // {
  1507. // float k = (pointList[selected][1].Y - pointList[selected][0].Y) / (pointList[selected][1].X - pointList[selected][0].X);
  1508. // float b = pointList[selected][0].Y - k * pointList[selected][0].X;
  1509. // if (Math.Abs(dxTemp) >= Math.Abs(dyTemp))
  1510. // {
  1511. // pointList[selected][3].X += dx;
  1512. // if (pointList[selected][2] == PointF.Empty)
  1513. // pointList[selected][3].X = FormatCoordinate(pointList[selected][0].X, pointList[selected][1].X, pointList[selected][3].X);
  1514. // else
  1515. // pointList[selected][3].X = FormatCoordinate(pointList[selected][2].X, pointList[selected][1].X, pointList[selected][3].X);
  1516. // pointList[selected][3].Y = k * pointList[selected][3].X + b;
  1517. // }
  1518. // else
  1519. // {
  1520. // pointList[selected][3].Y += dy;
  1521. // if (pointList[selected][2] == PointF.Empty)
  1522. // pointList[selected][3].Y = FormatCoordinate(pointList[selected][0].Y, pointList[selected][1].Y, pointList[selected][3].Y);
  1523. // else
  1524. // pointList[selected][3].Y = FormatCoordinate(pointList[selected][2].Y, pointList[selected][1].Y, pointList[selected][3].Y);
  1525. // pointList[selected][3].X = (pointList[selected][3].Y - b) / k;
  1526. // }
  1527. // }
  1528. // }
  1529. //}
  1530. //this.documentWorkspace.Refresh();
  1531. }
  1532. }
  1533. /// <summary>
  1534. /// 鼠标抬起
  1535. /// </summary>
  1536. /// <param name="sender"></param>
  1537. /// <param name="e"></param>
  1538. private void BoxMouseUpHandler(object sender, MouseEventArgs e)
  1539. {
  1540. if (operationK == 0)
  1541. {
  1542. //if (startPoint != null && endPoint != null && startPoint != endPoint)
  1543. //{
  1544. // if(checkBox2.Checked && checkBox3.Checked)
  1545. // {
  1546. // pointList[lineCount][2] = new PointF((2 * startPoint.X + endPoint.X) / 3f, (2 * startPoint.Y + endPoint.Y) / 3f);
  1547. // pointList[lineCount][3] = new PointF((startPoint.X + 2 * endPoint.X) / 3f, (startPoint.Y + 2 * endPoint.Y) / 3f);
  1548. // }
  1549. // else if (checkBox2.Checked && !checkBox3.Checked)
  1550. // {
  1551. // pointList[lineCount][2] = new PointF((startPoint.X + endPoint.X) / 2f, (startPoint.Y + endPoint.Y) / 2f);
  1552. // }
  1553. // else if (!checkBox2.Checked && checkBox3.Checked)
  1554. // {
  1555. // pointList[lineCount][3] = new PointF((startPoint.X + endPoint.X) / 2f, (startPoint.Y + endPoint.Y) / 2f);
  1556. // }
  1557. // RectangleF rectangleF = CalcOtherRectangle(pointList[lineCount][0], pointList[lineCount][1]);
  1558. // rectangleFList.Add(rectangleF);
  1559. // lineCount++;
  1560. // AddContentToDataGridView();
  1561. //}
  1562. //else
  1563. //{
  1564. // pointList.RemoveAt(pointList.Count - 1);
  1565. //}
  1566. //this.documentWorkspace.Refresh();
  1567. }
  1568. else if (operationK == 1)
  1569. {
  1570. //canMove = false;
  1571. //movePointIndex = -1;
  1572. //RefreshDataGridView1();
  1573. }
  1574. }
  1575. /// <summary>
  1576. /// 绘制事件
  1577. /// </summary>
  1578. /// <param name="sender"></param>
  1579. /// <param name="e"></param>
  1580. private void BoxPaintHandler(object sender, PaintEventArgs e)
  1581. {
  1582. if (this.documentWorkspace.CompositionSurface != null)
  1583. {
  1584. Rectangle rc = this.documentWorkspace.panel.ClientRectangle;
  1585. int width = (int)(this.documentWorkspace.CompositionSurface.Width * this.documentWorkspace.ScaleFactor.Ratio);
  1586. int height = (int)(this.documentWorkspace.CompositionSurface.Height * this.documentWorkspace.ScaleFactor.Ratio);
  1587. int x = (rc.Width < width) ? this.documentWorkspace.panel.AutoScrollPosition.X : (rc.Width - width) / 2;
  1588. int y = (rc.Height < height) ? this.documentWorkspace.panel.AutoScrollPosition.Y : (rc.Height - height) / 2;
  1589. e.Graphics.TranslateTransform(x, y);
  1590. e.Graphics.ScaleTransform((float)this.documentWorkspace.ScaleFactor.Ratio, (float)this.documentWorkspace.ScaleFactor.Ratio);
  1591. Draw(e.Graphics);
  1592. e.Graphics.ScaleTransform(1 / (float)this.documentWorkspace.ScaleFactor.Ratio, 1 / (float)this.documentWorkspace.ScaleFactor.Ratio);
  1593. e.Graphics.TranslateTransform(-x, -y);
  1594. }
  1595. }
  1596. /// <summary>
  1597. /// 绘制
  1598. /// </summary>
  1599. private void Draw(Graphics graphics)
  1600. {
  1601. graphics.SmoothingMode = SmoothingMode.AntiAlias;
  1602. //if (tempLine != null && tempLine.Length > 0 && !bcOriginChecked())
  1603. //{
  1604. // Pen lineColor = new Pen(this.rectLineColor, this.rectLineWidth);
  1605. // for (int index = 0; index < tempLine.Length; index++)
  1606. // {
  1607. // System.Drawing.Point[] tempLine1 = tempLine[index];
  1608. // graphics.DrawLines(lineColor, tempLine1);
  1609. // }
  1610. //}
  1611. int margin = (int)(Convert.ToInt32(this.textBox3.Text) * 1200.0 / physical_width);// Math.Min(this.bitmap.Width / 2 - 5, this.bitmap.Width / 20/*(int)(this.scopeMarginLeft / this.physical_length)*/);// this.bitmap.Width / 20;
  1612. margin = (int)(margin / this.physical_length);
  1613. Line lineleft = new Line(new System.Drawing.Point(margin, 0), new System.Drawing.Point(margin, this.bitmap.Height));
  1614. Line lineright = new Line(new System.Drawing.Point(this.bitmap.Width - margin, 0), new System.Drawing.Point(this.bitmap.Width - margin, this.bitmap.Height));
  1615. //this.parentDialog.rectLineColor = this.panel2.BackColor;
  1616. //this.parentDialog.baseLineColor = this.panel6.BackColor;
  1617. //this.parentDialog.scopeLineColor = this.panel7.BackColor;
  1618. //this.parentDialog.orgLineColor = this.panel3.BackColor;
  1619. //this.parentDialog.rect1LineColor = this.panel1.BackColor;
  1620. //this.parentDialog.rect2LineColor = this.panel8.BackColor;
  1621. //this.parentDialog.rect3LineColor = this.panel9.BackColor;
  1622. //this.parentDialog.assistLineColor = this.panel4.BackColor;
  1623. if (lineleft != null)//line
  1624. {
  1625. graphics.DrawLine(new Pen(this.panel7.BackColor, this.trackBar3.Value), lineleft.startPoint, lineleft.endPoint);
  1626. }
  1627. if (lineright != null)//line
  1628. {
  1629. graphics.DrawLine(new Pen(this.panel7.BackColor, this.trackBar3.Value), lineright.startPoint, lineright.endPoint);
  1630. }
  1631. //this.parentDialog.rectLineWidth = this.trackBar8.Value;
  1632. //this.parentDialog.baseLineWidth = this.trackBar1.Value;
  1633. //this.parentDialog.scopeLineWidth = this.trackBar3.Value;
  1634. //this.parentDialog.orgLineWidth = this.trackBar4.Value;
  1635. //this.parentDialog.rect1LineWidth = this.trackBar2.Value;
  1636. //this.parentDialog.rect2LineWidth = this.trackBar5.Value;
  1637. //this.parentDialog.rect3LineWidth = this.trackBar6.Value;
  1638. //this.parentDialog.assistLineWidth = this.trackBar7.Value;
  1639. int planesnum = 50;// planesnumcal;// int.Parse(Intent.dict["planesnum"].ToString());
  1640. int planesbottom = 50 + (int)(650/*600*/ / physical_length);// bottom.endPoint.Y;// int.Parse(Intent.dict["planesbottom"].ToString());
  1641. //if (((planesbottom - planesnum) * physical_length) < 500)
  1642. //{
  1643. // this.drawLines();
  1644. // MessageBox.Show(PdnResources.GetString("Menu.Thedistancebeselectagain.text"));
  1645. // return;
  1646. //}
  1647. Line top = new Line(new System.Drawing.Point(0, planesnum), new System.Drawing.Point(this.bitmap.Width, planesnum));
  1648. Line bottom = new Line(new System.Drawing.Point(0, planesbottom), new System.Drawing.Point(this.bitmap.Width, planesbottom));
  1649. if (top != null && bottom != null)
  1650. {
  1651. //int planesnum = top.startPoint.Y;// int.Parse(Intent.dict["planesnum"].ToString());
  1652. int planesbottom1 = planesnum + +(int)(200 / physical_length);
  1653. int planesbottom2 = planesnum + +(int)(400 / physical_length);
  1654. int planesbottom3 = bottom.startPoint.Y;// int.Parse(Intent.dict["planesbottom"].ToString());
  1655. if (((bottom.startPoint.Y - planesnum) * physical_length) > 600)
  1656. {
  1657. planesbottom3 = planesnum + +(int)(600 / physical_length);
  1658. }
  1659. graphics.DrawLine(new Pen(this.panel1.BackColor, this.trackBar2.Value), new System.Drawing.Point(0, planesbottom1), new System.Drawing.Point(this.bitmap.Width, planesbottom1));
  1660. graphics.DrawLine(new Pen(this.panel8.BackColor, this.trackBar5.Value), new System.Drawing.Point(0, planesbottom2), new System.Drawing.Point(this.bitmap.Width, planesbottom2));
  1661. if (((bottom.startPoint.Y - planesnum) * physical_length) > 600)
  1662. {
  1663. graphics.DrawLine(new Pen(this.panel9.BackColor, this.trackBar6.Value), new System.Drawing.Point(0, planesbottom3), new System.Drawing.Point(this.bitmap.Width, planesbottom3));
  1664. }
  1665. graphics.DrawLine(new Pen(this.panel3.BackColor, this.trackBar4.Value), top.startPoint, top.endPoint);
  1666. graphics.DrawLine(new Pen(this.panel6.BackColor, this.trackBar1.Value), bottom.startPoint, bottom.endPoint);
  1667. }
  1668. else if (bottom != null)
  1669. {
  1670. graphics.DrawLine(new Pen(this.panel6.BackColor, this.trackBar1.Value), bottom.startPoint, bottom.endPoint);
  1671. }
  1672. }
  1673. /// <summary>
  1674. /// 计算外接矩形
  1675. /// </summary>
  1676. private RectangleF CalcOtherRectangle(PointF p1, PointF p2)
  1677. {
  1678. RectangleF rectangleF = new RectangleF();
  1679. if (p1.X > p2.X)
  1680. rectangleF.X = p2.X;
  1681. else
  1682. rectangleF.X = p1.X;
  1683. if (p1.Y > p2.Y)
  1684. rectangleF.Y = p2.Y;
  1685. else
  1686. rectangleF.Y = p1.Y;
  1687. rectangleF.Width = Math.Abs(p2.X - p1.X);
  1688. rectangleF.Height = Math.Abs(p2.Y - p1.Y);
  1689. return new RectangleF(rectangleF.X - 3, rectangleF.Y - 3, rectangleF.Width + 7, rectangleF.Height + 7);
  1690. }
  1691. ///// <summary>
  1692. ///// 相颜色点击事件
  1693. ///// </summary>
  1694. ///// <param name="sender"></param>
  1695. ///// <param name="e"></param>
  1696. //private void panel6_Click(object sender, EventArgs e)
  1697. //{
  1698. // this.panelC = (Panel)sender;
  1699. // this.colorsFormGrid.UserPrimaryColor = ColorBgra.FromColor(this.panel2.BackColor);
  1700. // //this.colorsFormGrid.setSaveBtn_Click(new System.EventHandler(this.gridColorChanged));
  1701. // this.colorsFormGrid.ShowDialog();
  1702. //}
  1703. /// <summary>
  1704. /// PanelC的调色板颜色改变
  1705. /// </summary>
  1706. /// <param name="sender"></param>
  1707. /// <param name="e"></param>
  1708. private void gridColorChanged(object sender, EventArgs e)
  1709. {
  1710. Color color = this.colorsFormGrid.UserPrimaryColor.ToColor();
  1711. //更改背景色,触发事件
  1712. this.panelC.BackColor = color;
  1713. //if (this.panelC == this.panel2)
  1714. // this.parentDialog.rectLineColor = color;
  1715. //else if (this.panelC == this.panel6)
  1716. // this.parentDialog.baseLineColor = color;
  1717. //else if (this.panelC == this.panel7)
  1718. // this.parentDialog.scopeLineColor = color;
  1719. //else if (this.panelC == this.panel3)
  1720. // this.parentDialog.orgLineColor = color;
  1721. //else if (this.panelC == this.panel1)
  1722. // this.parentDialog.rect1LineColor = color;
  1723. //else if (this.panelC == this.panel8)
  1724. // this.parentDialog.rect2LineColor = color;
  1725. //else if (this.panelC == this.panel9)
  1726. // this.parentDialog.rect3LineColor = color;
  1727. //else if (this.panelC == this.panel4)
  1728. // this.parentDialog.assistLineColor = color;
  1729. //this.parentDialog.refreshWorkSpace();
  1730. this.documentWorkspace.Refresh();
  1731. //关闭色板
  1732. this.colorsFormGrid.Close();
  1733. }
  1734. private void textBox1_KeyUp(object sender, KeyEventArgs e)
  1735. {
  1736. this.varifyTextBoxValue(sender);
  1737. this.trackBar1.Value = Convert.ToInt32(((TextBox)sender).Text);
  1738. this.documentWorkspace.Refresh();
  1739. }
  1740. /// <summary>
  1741. /// 线宽输入框 对输入值做限制
  1742. /// </summary>
  1743. /// <param name="sender"></param>
  1744. private void varifyTextBoxValue(object sender)
  1745. {
  1746. if (string.IsNullOrEmpty(((TextBox)sender)/*this.textBox2*/.Text))
  1747. ((TextBox)sender)/*this.textBox2*/.Text = "1";
  1748. if (Convert.ToInt32(((TextBox)sender)/*this.textBox2*/.Text) > 50)
  1749. ((TextBox)sender)/*this.textBox2*/.Text = "50";
  1750. }
  1751. private void textBox5_KeyUp(object sender, KeyEventArgs e)
  1752. {
  1753. this.varifyTextBoxValue(sender);
  1754. this.trackBar3.Value = Convert.ToInt32(((TextBox)sender).Text);
  1755. this.documentWorkspace.Refresh();
  1756. }
  1757. private void textBox10_KeyUp(object sender, KeyEventArgs e)
  1758. {
  1759. this.varifyTextBoxValue(sender);
  1760. this.trackBar4.Value = Convert.ToInt32(((TextBox)sender).Text);
  1761. this.documentWorkspace.Refresh();
  1762. }
  1763. private void textBox2_KeyUp(object sender, KeyEventArgs e)
  1764. {
  1765. this.varifyTextBoxValue(sender);
  1766. this.trackBar2.Value = Convert.ToInt32(((TextBox)sender).Text);
  1767. this.documentWorkspace.Refresh();
  1768. }
  1769. private void textBox4_KeyUp(object sender, KeyEventArgs e)
  1770. {
  1771. this.varifyTextBoxValue(sender);
  1772. this.trackBar5.Value = Convert.ToInt32(((TextBox)sender).Text);
  1773. this.documentWorkspace.Refresh();
  1774. }
  1775. private void textBox6_KeyUp(object sender, KeyEventArgs e)
  1776. {
  1777. this.varifyTextBoxValue(sender);
  1778. this.trackBar6.Value = Convert.ToInt32(((TextBox)sender).Text);
  1779. this.documentWorkspace.Refresh();
  1780. }
  1781. private void textBox9_KeyUp(object sender, KeyEventArgs e)
  1782. {
  1783. this.varifyTextBoxValue(sender);
  1784. this.trackBar7.Value = Convert.ToInt32(((TextBox)sender).Text);
  1785. this.documentWorkspace.Refresh();
  1786. }
  1787. private void textBox7_KeyUp(object sender, KeyEventArgs e)
  1788. {
  1789. this.varifyTextBoxValue(sender);
  1790. this.trackBar8.Value = Convert.ToInt32(((TextBox)sender).Text);
  1791. this.documentWorkspace.Refresh();
  1792. }
  1793. private void panel6_Click(object sender, EventArgs e)
  1794. {
  1795. this.panelC = (Panel)sender;
  1796. this.colorsFormGrid.UserPrimaryColor = ColorBgra.FromColor(((Panel)sender).BackColor);
  1797. this.colorsFormGrid.ShowDialog();
  1798. }
  1799. private void trackBar1_Scroll(object sender, EventArgs e)
  1800. {
  1801. this.textBox1.Text = "" + ((TrackBar)sender).Value;
  1802. this.documentWorkspace.Refresh();
  1803. }
  1804. private void trackBar3_Scroll(object sender, EventArgs e)
  1805. {
  1806. this.textBox5.Text = "" + ((TrackBar)sender).Value;
  1807. this.documentWorkspace.Refresh();
  1808. }
  1809. private void trackBar4_Scroll(object sender, EventArgs e)
  1810. {
  1811. this.textBox10.Text = "" + ((TrackBar)sender).Value;
  1812. this.documentWorkspace.Refresh();
  1813. }
  1814. private void trackBar2_Scroll(object sender, EventArgs e)
  1815. {
  1816. this.textBox2.Text = "" + ((TrackBar)sender).Value;
  1817. this.documentWorkspace.Refresh();
  1818. }
  1819. private void trackBar5_Scroll(object sender, EventArgs e)
  1820. {
  1821. this.textBox4.Text = "" + ((TrackBar)sender).Value;
  1822. this.documentWorkspace.Refresh();
  1823. }
  1824. private void trackBar6_Scroll(object sender, EventArgs e)
  1825. {
  1826. this.textBox6.Text = "" + ((TrackBar)sender).Value;
  1827. this.documentWorkspace.Refresh();
  1828. }
  1829. private void trackBar7_Scroll(object sender, EventArgs e)
  1830. {
  1831. this.textBox9.Text = "" + ((TrackBar)sender).Value;
  1832. this.documentWorkspace.Refresh();
  1833. }
  1834. /// <summary>
  1835. /// 关闭
  1836. /// </summary>
  1837. /// <param name="sender"></param>
  1838. /// <param name="e"></param>
  1839. private void button10_Click(object sender, EventArgs e)
  1840. {
  1841. this.Close();
  1842. }
  1843. private void textBox3_KeyUp(object sender, KeyEventArgs e)
  1844. {
  1845. if (string.IsNullOrEmpty(((TextBox)sender)/*this.textBox2*/.Text))
  1846. ((TextBox)sender)/*this.textBox2*/.Text = "1";
  1847. if (this.bitmap != null)
  1848. {
  1849. int maxMargin = (int)((this.physical_width/*bitmap.Width*/ / 2 - 5) * physical_length/*physical_length11*/);// Math.Min(this.bitmap.Width / 2 - 5, this.bitmap.Width / 20/*(int)(this.scopeMarginLeft / this.physical_length)*/);// this.bitmap.Width / 20;
  1850. int margin;
  1851. if (int.TryParse(((TextBox)sender)/*this.textBox2*/.Text, out margin) && margin > maxMargin)
  1852. {
  1853. ((TextBox)sender)/*this.textBox2*/.Text = maxMargin + "";
  1854. }
  1855. }
  1856. else
  1857. {
  1858. if (Convert.ToInt32(((TextBox)sender)/*this.textBox2*/.Text) > 500)
  1859. ((TextBox)sender)/*this.textBox2*/.Text = "500";
  1860. }
  1861. this.documentWorkspace.Refresh();
  1862. }
  1863. private void trackBar8_Scroll(object sender, EventArgs e)
  1864. {
  1865. this.textBox7.Text = "" + ((TrackBar)sender).Value;
  1866. this.documentWorkspace.Refresh();
  1867. }
  1868. }
  1869. }