ChangeViewDialog.cs 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848
  1. using PaintDotNet.Annotation;
  2. using PaintDotNet.Annotation.Enum;
  3. using PaintDotNet.Annotation.FieldView;
  4. using PaintDotNet.DbOpreate.DbBll;
  5. using PaintDotNet.DbOpreate.DbModel;
  6. using System;
  7. using System.Drawing;
  8. using System.Windows.Forms;
  9. namespace PaintDotNet.FieldView
  10. {
  11. /// <summary>
  12. /// 修改视场
  13. /// </summary>
  14. internal class ChangeViewDialog : FloatingToolForm//PdnBaseForm
  15. {
  16. /// <summary>
  17. /// 主工作控件
  18. /// </summary>
  19. private AppWorkspace appWorkspace;
  20. /// <summary>
  21. /// 当前选中的视场
  22. /// </summary>
  23. private DrawObject _selectedObject;
  24. /// <summary>
  25. /// 旧中心点X坐标值
  26. /// </summary>
  27. private int _lastCenterX;
  28. /// <summary>
  29. /// 旧中心点Y坐标值
  30. /// </summary>
  31. private int _lastCenterY;
  32. /// <summary>
  33. /// 初始化标记
  34. /// 1、用于第一次打开窗口时
  35. /// 2、用于切换视场事件被触发时
  36. /// </summary>
  37. private bool init = true;
  38. double PxPerUnit => double.Parse(appWorkspace.GetPxPerUnit()[4]);
  39. double WidthValue
  40. {
  41. get
  42. {
  43. var value = 0d;
  44. double.TryParse(nudActualWidth.Text, out value);
  45. return value;
  46. }
  47. set
  48. {
  49. nudActualWidth.Text = Math.Round(value > 1 ? value : 1, 2).ToString();
  50. }
  51. }
  52. double HeightValue
  53. {
  54. get
  55. {
  56. var value = 0d;
  57. double.TryParse(nudActualHeight.Text, out value);
  58. return value;
  59. }
  60. set
  61. {
  62. nudActualHeight.Text = Math.Round(value > 1 ? value : 1, 2).ToString("f2");
  63. }
  64. }
  65. double WidthPxValue
  66. {
  67. get
  68. {
  69. var value = 0d;
  70. double.TryParse(lblPixelWidth.Text, out value);
  71. return value;
  72. }
  73. set
  74. {
  75. lblPixelWidth.Text = Math.Round(value > 1 ? value : 1, 0).ToString();
  76. }
  77. }
  78. double HeightPxValue
  79. {
  80. get
  81. {
  82. var value = 0d;
  83. double.TryParse(lblPixelHeight.Text, out value);
  84. return value;
  85. }
  86. set
  87. {
  88. lblPixelHeight.Text = Math.Round(value > 0 ? value : 0, 0).ToString();
  89. }
  90. }
  91. int CenterX
  92. {
  93. get
  94. {
  95. var value = 0;
  96. int.TryParse(nudCenterX.Text, out value);
  97. return value;
  98. }
  99. set
  100. {
  101. nudCenterX.Text = value.ToString();
  102. }
  103. }
  104. int CenterY
  105. {
  106. get
  107. {
  108. var value = 0;
  109. int.TryParse(nudCenterY.Text, out value);
  110. return value;
  111. }
  112. set
  113. {
  114. nudCenterY.Text = value.ToString();
  115. }
  116. }
  117. public ChangeViewDialog(AppWorkspace appWorkspace)
  118. {
  119. this.appWorkspace = appWorkspace;
  120. InitializeComponent();
  121. InitializeLanguageText();
  122. this._selectedObject = this.appWorkspace.ActiveDocumentWorkspace.GraphicsList.SelectDrawObject;
  123. this.appWorkspace.ActiveDocumentWorkspace.GraphicsList.SelectChanged += this.graphicsList_SelectChanged;
  124. this.FormClosing += (s, e) => this.appWorkspace.ActiveDocumentWorkspace.GraphicsList.SelectChanged -= this.graphicsList_SelectChanged;
  125. InitControl();
  126. nudActualWidth.MouseWheel += NudActualWidth_MouseWheel;
  127. nudActualHeight.MouseWheel += NudActualHeight_MouseWheel;
  128. nudCenterX.MouseWheel += nudCenterX_MouseWheel;
  129. nudCenterY.MouseWheel += nudCenterY_MouseWheel;
  130. }
  131. /// <summary>
  132. /// 初始化控件及其值
  133. /// </summary>
  134. private void InitControl()
  135. {
  136. if (_selectedObject != null)
  137. {
  138. if (this.appWorkspace.ActiveDocumentWorkspace.xmlSaveModel != null)
  139. {
  140. this.label2.Text = PdnResources.GetString("Menu.LabelAction.DrawGainNumber.Text") + ":" + this.appWorkspace.ActiveDocumentWorkspace.xmlSaveModel.gain_multiple;
  141. }
  142. else
  143. {
  144. this.label2.Text = PdnResources.GetString("Menu.ationrulcurrentlydefaultvalueis.Text");
  145. }
  146. DrawToolType type = _selectedObject.drawToolType;
  147. InitializeText(type);
  148. InitializeHide(type);
  149. InitializeValues(type);
  150. EndSizeChange();
  151. init = false;
  152. }
  153. }
  154. private void InitializeText(DrawToolType type)
  155. {
  156. this.lblWidth.Text = PdnResources.GetString("Menu.width.text");
  157. this.lblWidthPx.Text = PdnResources.GetString("Menu.width.text");
  158. this.lblHeight.Text = PdnResources.GetString("Menu.height.text");
  159. this.lblHeightPx.Text = PdnResources.GetString("Menu.height.text");
  160. label4.Text = "μm";
  161. switch (type)
  162. {
  163. case DrawToolType.ViewOval:
  164. this.label1.Text = PdnResources.GetString("Menu.ViewSetting.OvalView.Text");
  165. this.lblWidth.Text = PdnResources.GetString("Menu.horizontalaxis.Text");
  166. this.lblWidthPx.Text = PdnResources.GetString("Menu.horizontalaxis.Text");
  167. this.lblHeight.Text = PdnResources.GetString("Menu.verticalaxis.Text");
  168. this.lblHeightPx.Text = PdnResources.GetString("Menu.verticalaxis.Text");
  169. break;
  170. case DrawToolType.ViewCircle:
  171. this.label1.Text = PdnResources.GetString("Menu.ViewSetting.RoundView.Text");
  172. this.lblHeight.Text = PdnResources.GetString("Menu.area.text");
  173. this.lblWidth.Text = PdnResources.GetString("Menu.diameter.text");
  174. this.lblWidthPx.Text = PdnResources.GetString("Menu.diameter.text");
  175. this.lblHeightPx.Text = PdnResources.GetString("Menu.height.text");
  176. label4.Text = "μm²";
  177. break;
  178. case DrawToolType.ViewRectangleEx:
  179. this.label1.Text = PdnResources.GetString("Menu.ViewSetting.RectangleExView.Text");
  180. break;
  181. case DrawToolType.ViewPolygon:
  182. this.label1.Text = PdnResources.GetString("Menu.ViewSetting.PolygonView.Text");
  183. break;
  184. case DrawToolType.ViewRectangle:
  185. this.label1.Text = PdnResources.GetString("Menu.ViewSetting.RectangleView.Text");
  186. break;
  187. case DrawToolType.ViewTriangle:
  188. this.label1.Text = PdnResources.GetString("Menu.ViewSetting.TriangleView.Text");
  189. this.lblWidth.Text = PdnResources.GetString("Menu.Horizontalsidelength.Text");
  190. this.lblWidthPx.Text = PdnResources.GetString("Menu.Horizontalsidelength.Text");
  191. this.lblHeight.Text = PdnResources.GetString("Menu.Verticalsidelength.Text");
  192. this.lblHeightPx.Text = PdnResources.GetString("Menu.Verticalsidelength.Text");
  193. break;
  194. case DrawToolType.ViewTriangleEx:
  195. this.label1.Text = PdnResources.GetString("Menu.ViewSetting.TriangleExView.Text");
  196. break;
  197. case DrawToolType.ViewSquare:
  198. this.label1.Text = PdnResources.GetString("Menu.ViewSetting.SquareView.Text");
  199. this.lblWidth.Text = PdnResources.GetString("Menu.Generalanalysis.Processmparison.Sidelength.text");
  200. this.lblHeight.Text = PdnResources.GetString("Menu.area.text");
  201. lblWidthPx.Text = PdnResources.GetString("Menu.Generalanalysis.Processmparison.Sidelength.text");
  202. label4.Text = "μm²";
  203. break;
  204. }
  205. }
  206. private void InitializeValues(DrawToolType type)
  207. {
  208. WidthValue = _selectedObject.Width * PxPerUnit;
  209. HeightValue = _selectedObject.Height * PxPerUnit;
  210. WidthPxValue = _selectedObject.Width;
  211. HeightPxValue = _selectedObject.Height;
  212. switch (type)
  213. {
  214. case DrawToolType.ViewCircle:
  215. HeightValue = GetCircleArea();
  216. break;
  217. case DrawToolType.ViewSquare:
  218. HeightValue = GetSquareArea();
  219. break;
  220. }
  221. }
  222. private void InitializeHide(DrawToolType type)
  223. {
  224. lblHeightPx.Visible = true;
  225. lblPixelHeight.Visible = true;
  226. lblPixelHeightUnit.Visible = true;
  227. nudActualWidth.Enabled = true;
  228. nudActualWidth.Enabled = true;
  229. switch (type)
  230. {
  231. case DrawToolType.ViewSquare:
  232. case DrawToolType.ViewCircle:
  233. lblHeightPx.Visible = false;
  234. lblPixelHeight.Visible = false;
  235. lblPixelHeightUnit.Visible = false;
  236. break;
  237. case DrawToolType.ViewRectangleEx:
  238. case DrawToolType.ViewTriangleEx:
  239. case DrawToolType.ViewPolygon:
  240. nudActualWidth.Enabled = false;
  241. nudActualHeight.Enabled = false;
  242. break;
  243. }
  244. }
  245. double GetCircleArea()
  246. {
  247. var value = _selectedObject.Width * PxPerUnit;
  248. value = value * value / 4 * Math.PI;
  249. return value;
  250. }
  251. double GetSquareArea()
  252. {
  253. var value = _selectedObject.Width * PxPerUnit;
  254. value = value * value;
  255. return value;
  256. }
  257. private void disabledControl()
  258. {
  259. this.nudActualHeight.Enabled = false;
  260. this.nudActualWidth.Enabled = false;
  261. this.nudCenterX.Enabled = false;
  262. this.nudCenterY.Enabled = false;
  263. }
  264. private void enabledControl(DrawToolType drawToolType)
  265. {
  266. //如果是多边形或者任意三角形,没有边长什么的,所以不允许编辑
  267. if (drawToolType != DrawToolType.ViewPolygon && drawToolType != DrawToolType.ViewTriangleEx)
  268. {
  269. this.nudActualHeight.Enabled = true;
  270. this.nudActualWidth.Enabled = true;
  271. }
  272. this.nudCenterX.Enabled = true;
  273. this.nudCenterY.Enabled = true;
  274. }
  275. /// <summary>
  276. /// 视场对象改变事件
  277. /// </summary>
  278. /// <param name="sender"></param>
  279. /// <param name="e"></param>
  280. private void graphicsList_SelectChanged(object sender, EventArgs e)
  281. {
  282. this._selectedObject = this.appWorkspace.ActiveDocumentWorkspace.GraphicsList.SelectDrawObject;
  283. if (_selectedObject == null || _selectedObject.objectType != DrawClass.View)
  284. {
  285. disabledControl();
  286. }
  287. else
  288. {
  289. enabledControl(_selectedObject.drawToolType);
  290. init = true;
  291. this._selectedObject.PropertyChanged -= this.selectedObject_PropertyChanged;
  292. InitControl();
  293. this._selectedObject.PropertyChanged += this.selectedObject_PropertyChanged;
  294. }
  295. }
  296. /// <summary>
  297. /// 选中的视场的属性改变事件
  298. /// </summary>
  299. /// <param name="sender"></param>
  300. /// <param name="e"></param>
  301. private void selectedObject_PropertyChanged(object sender, EventArgs e)
  302. {
  303. InitControl();
  304. }
  305. bool CheckFloat(TextBox input, KeyPressEventArgs e)
  306. {
  307. if (e.KeyChar == (char)Keys.Delete)
  308. {
  309. if (input.Text.Contains("."))
  310. return true;
  311. }
  312. else if (!char.IsDigit(e.KeyChar) && (e.KeyChar != (char)Keys.Enter) && (e.KeyChar != (char)Keys.Back)) // 非数字键, 放弃该输入
  313. {
  314. return true;
  315. }
  316. return false;
  317. }
  318. private void NudActualWidth_MouseWheel(object sender, MouseEventArgs e)
  319. {
  320. WidthValue += e.Delta > 0 ? 1 : -1;
  321. ActualWidthChanged();
  322. }
  323. private void nudActualWidth_KeyPress(object sender, KeyPressEventArgs e)
  324. {
  325. TextBox input = sender as TextBox;
  326. var r = CheckFloat(input, e);
  327. if (r) { e.Handled = true; return; }
  328. if (e.KeyChar == (char)Keys.Enter)
  329. {
  330. ActualWidthChanged();
  331. }
  332. }
  333. private void ActualWidthChanged()
  334. {
  335. double value = WidthValue;
  336. value = value / PxPerUnit;
  337. _selectedObject.Width = value;
  338. WidthPxValue = value;
  339. if (_selectedObject.drawToolType == DrawToolType.ViewCircle) HeightValue = GetCircleArea();
  340. if (_selectedObject.drawToolType == DrawToolType.ViewSquare) HeightValue = GetSquareArea();
  341. EndSizeChange();
  342. }
  343. private void NudActualHeight_MouseWheel(object sender, MouseEventArgs e)
  344. {
  345. HeightValue += e.Delta > 0 ? 1 : -1;
  346. ActualHeigthChanged();
  347. }
  348. private void nudActualHeight_KeyPress(object sender, KeyPressEventArgs e)
  349. {
  350. TextBox input = sender as TextBox;
  351. var r = CheckFloat(input, e);
  352. if (r) { e.Handled = true; return; }
  353. if (e.KeyChar == (char)Keys.Enter)
  354. {
  355. ActualHeigthChanged();
  356. }
  357. }
  358. /// <summary>
  359. /// 高度 或 面积 修改
  360. /// </summary>
  361. private void ActualHeigthChanged()
  362. {
  363. double value = HeightValue;
  364. if (_selectedObject.drawToolType == DrawToolType.ViewCircle)
  365. {
  366. value = WidthValue = Math.Sqrt(value / Math.PI) * 2;
  367. WidthValue = value;
  368. _selectedObject.Width = value / PxPerUnit;
  369. WidthPxValue = value / PxPerUnit;
  370. }
  371. else if (_selectedObject.drawToolType == DrawToolType.ViewSquare)
  372. {
  373. value = Math.Sqrt(value);
  374. WidthValue = value;
  375. _selectedObject.Width = value / PxPerUnit;
  376. WidthPxValue = value / PxPerUnit;
  377. }
  378. else
  379. {
  380. value = value / PxPerUnit;
  381. _selectedObject.Height = value;
  382. HeightPxValue = value;
  383. }
  384. EndSizeChange();
  385. }
  386. bool CheckInt(TextBox input, KeyPressEventArgs e)
  387. {
  388. if (!char.IsDigit(e.KeyChar) && (e.KeyChar != (char)Keys.Enter) && (e.KeyChar != (char)Keys.Back)) // 非数字键, 放弃该输入
  389. {
  390. return true;
  391. }
  392. return false;
  393. }
  394. private void nudCenterX_KeyPress(object sender, KeyPressEventArgs e)
  395. {
  396. TextBox input = sender as TextBox;
  397. var r = CheckInt(input, e);
  398. if (r) { e.Handled = true; return; }
  399. if (e.KeyChar == (char)Keys.Enter)
  400. {
  401. DrawObjectMove();
  402. }
  403. }
  404. private void nudCenterX_MouseWheel(object sender, MouseEventArgs e)
  405. {
  406. CenterX += e.Delta > 0 ? 1 : -1;
  407. DrawObjectMove();
  408. }
  409. private void nudCenterY_MouseWheel(object sender, MouseEventArgs e)
  410. {
  411. CenterY += e.Delta > 0 ? 1 : -1;
  412. DrawObjectMove();
  413. }
  414. void DrawObjectMove()
  415. {
  416. if (_selectedObject == null) return;
  417. if (this._lastCenterY != CenterY)
  418. {
  419. int deltaY = CenterY - this._lastCenterY;
  420. this._selectedObject.Move(0, deltaY);
  421. this._lastCenterY = CenterY;
  422. }
  423. if (this._lastCenterX != CenterX)
  424. {
  425. int deltaX = CenterX - this._lastCenterX;
  426. this._selectedObject.Move(deltaX, 0);
  427. this._lastCenterX = CenterX;
  428. }
  429. this._selectedObject.Normalize();
  430. this.appWorkspace.ActiveDocumentWorkspace.Refresh();
  431. }
  432. private void EndSizeChange()
  433. {
  434. this.appWorkspace.ActiveDocumentWorkspace.Refresh();
  435. int centerX = (int)(_selectedObject.Rectangle.X + Math.Abs(_selectedObject.Rectangle.Width / 2));
  436. int centerY = (int)(_selectedObject.Rectangle.Y + Math.Abs(_selectedObject.Rectangle.Height / 2));
  437. this._lastCenterX = centerX;
  438. this._lastCenterY = centerY;
  439. CenterX = centerX;
  440. CenterY = centerY;
  441. }
  442. private void InitializeLanguageText()
  443. {
  444. // this.unit = PdnResources.GetString("Menu.Micron.text");
  445. this.groupBox2.Text = PdnResources.GetString("Menu.view.text");
  446. this.groupBox3.Text = PdnResources.GetString("Menu.Ruler.text");
  447. this.groupBox4.Text = PdnResources.GetString("Menu.Edit.ActualSize.Text");
  448. this.groupBox5.Text = PdnResources.GetString("Menu.viewsetting.Modifyview.Visualsize.text");
  449. this.groupBox6.Text = PdnResources.GetString("Menu.position.text");
  450. this.label5.Text = PdnResources.GetString("Menu.viewsetting.Modifyview.Centerpoint.text") + "Y";
  451. this.Text = PdnResources.GetString("Menu.ViewSetting.ModifyFieldOfView.Text");
  452. this.label6.Text = PdnResources.GetString("Menu.viewsetting.Modifyview.Centerpoint.text") + "X";
  453. }
  454. private void InitializeComponent()
  455. {
  456. this.groupBox2 = new System.Windows.Forms.GroupBox();
  457. this.label1 = new System.Windows.Forms.Label();
  458. this.groupBox3 = new System.Windows.Forms.GroupBox();
  459. this.label2 = new System.Windows.Forms.Label();
  460. this.groupBox4 = new System.Windows.Forms.GroupBox();
  461. this.nudActualWidth = new System.Windows.Forms.TextBox();
  462. this.nudActualHeight = new System.Windows.Forms.TextBox();
  463. this.lblWidth = new System.Windows.Forms.Label();
  464. this.lblHeight = new System.Windows.Forms.Label();
  465. this.label3 = new System.Windows.Forms.Label();
  466. this.label4 = new System.Windows.Forms.Label();
  467. this.lblHeightPx = new System.Windows.Forms.Label();
  468. this.groupBox5 = new System.Windows.Forms.GroupBox();
  469. this.lblPixelWidth = new System.Windows.Forms.Label();
  470. this.lblPixelHeight = new System.Windows.Forms.Label();
  471. this.lblWidthPx = new System.Windows.Forms.Label();
  472. this.lblPixelHeightUnit = new System.Windows.Forms.Label();
  473. this.label7 = new System.Windows.Forms.Label();
  474. this.groupBox6 = new System.Windows.Forms.GroupBox();
  475. this.nudCenterY = new System.Windows.Forms.TextBox();
  476. this.nudCenterX = new System.Windows.Forms.TextBox();
  477. this.label5 = new System.Windows.Forms.Label();
  478. this.label6 = new System.Windows.Forms.Label();
  479. this.label9 = new System.Windows.Forms.Label();
  480. this.label10 = new System.Windows.Forms.Label();
  481. this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
  482. this.groupBox2.SuspendLayout();
  483. this.groupBox3.SuspendLayout();
  484. this.groupBox4.SuspendLayout();
  485. this.groupBox5.SuspendLayout();
  486. this.groupBox6.SuspendLayout();
  487. this.tableLayoutPanel1.SuspendLayout();
  488. this.SuspendLayout();
  489. //
  490. // groupBox2
  491. //
  492. this.groupBox2.Controls.Add(this.label1);
  493. this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill;
  494. this.groupBox2.Location = new System.Drawing.Point(3, 3);
  495. this.groupBox2.Name = "groupBox2";
  496. this.groupBox2.Size = new System.Drawing.Size(424, 46);
  497. this.groupBox2.TabIndex = 2;
  498. this.groupBox2.TabStop = false;
  499. this.groupBox2.Text = "视场";
  500. //
  501. // label1
  502. //
  503. this.label1.AutoSize = true;
  504. this.label1.Location = new System.Drawing.Point(7, 22);
  505. this.label1.Name = "label1";
  506. this.label1.Size = new System.Drawing.Size(41, 12);
  507. this.label1.TabIndex = 0;
  508. this.label1.Text = "label1";
  509. //
  510. // groupBox3
  511. //
  512. this.groupBox3.Controls.Add(this.label2);
  513. this.groupBox3.Dock = System.Windows.Forms.DockStyle.Fill;
  514. this.groupBox3.Location = new System.Drawing.Point(3, 55);
  515. this.groupBox3.Name = "groupBox3";
  516. this.groupBox3.Size = new System.Drawing.Size(424, 46);
  517. this.groupBox3.TabIndex = 3;
  518. this.groupBox3.TabStop = false;
  519. this.groupBox3.Text = "标尺";
  520. //
  521. // label2
  522. //
  523. this.label2.AutoSize = true;
  524. this.label2.Location = new System.Drawing.Point(9, 21);
  525. this.label2.Name = "label2";
  526. this.label2.Size = new System.Drawing.Size(41, 12);
  527. this.label2.TabIndex = 0;
  528. this.label2.Text = "label2";
  529. //
  530. // groupBox4
  531. //
  532. this.groupBox4.Controls.Add(this.nudActualWidth);
  533. this.groupBox4.Controls.Add(this.nudActualHeight);
  534. this.groupBox4.Controls.Add(this.lblWidth);
  535. this.groupBox4.Controls.Add(this.lblHeight);
  536. this.groupBox4.Controls.Add(this.label3);
  537. this.groupBox4.Controls.Add(this.label4);
  538. this.groupBox4.Dock = System.Windows.Forms.DockStyle.Fill;
  539. this.groupBox4.Location = new System.Drawing.Point(3, 107);
  540. this.groupBox4.Name = "groupBox4";
  541. this.groupBox4.Size = new System.Drawing.Size(424, 46);
  542. this.groupBox4.TabIndex = 4;
  543. this.groupBox4.TabStop = false;
  544. this.groupBox4.Text = "实际大小";
  545. //
  546. // nudActualWidth
  547. //
  548. this.nudActualWidth.Location = new System.Drawing.Point(60, 22);
  549. this.nudActualWidth.Name = "nudActualWidth";
  550. this.nudActualWidth.Size = new System.Drawing.Size(111, 21);
  551. this.nudActualWidth.TabIndex = 10;
  552. this.nudActualWidth.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
  553. this.nudActualWidth.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.nudActualWidth_KeyPress);
  554. //
  555. // nudActualHeight
  556. //
  557. this.nudActualHeight.Location = new System.Drawing.Point(275, 22);
  558. this.nudActualHeight.Name = "nudActualHeight";
  559. this.nudActualHeight.Size = new System.Drawing.Size(111, 21);
  560. this.nudActualHeight.TabIndex = 9;
  561. this.nudActualHeight.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
  562. this.nudActualHeight.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.nudActualHeight_KeyPress);
  563. //
  564. // lblWidth
  565. //
  566. this.lblWidth.AutoSize = true;
  567. this.lblWidth.Location = new System.Drawing.Point(9, 26);
  568. this.lblWidth.Name = "lblWidth";
  569. this.lblWidth.Size = new System.Drawing.Size(29, 12);
  570. this.lblWidth.TabIndex = 7;
  571. this.lblWidth.Text = "宽度";
  572. //
  573. // lblHeight
  574. //
  575. this.lblHeight.AutoSize = true;
  576. this.lblHeight.Location = new System.Drawing.Point(222, 26);
  577. this.lblHeight.Name = "lblHeight";
  578. this.lblHeight.Size = new System.Drawing.Size(29, 12);
  579. this.lblHeight.TabIndex = 9;
  580. this.lblHeight.Text = "高度";
  581. //
  582. // label3
  583. //
  584. this.label3.AutoSize = true;
  585. this.label3.Location = new System.Drawing.Point(174, 28);
  586. this.label3.Name = "label3";
  587. this.label3.Size = new System.Drawing.Size(23, 12);
  588. this.label3.TabIndex = 11;
  589. this.label3.Text = "μm";
  590. //
  591. // label4
  592. //
  593. this.label4.AutoSize = true;
  594. this.label4.Location = new System.Drawing.Point(388, 28);
  595. this.label4.Name = "label4";
  596. this.label4.Size = new System.Drawing.Size(29, 12);
  597. this.label4.TabIndex = 12;
  598. this.label4.Text = "μm²";
  599. //
  600. // lblHeightPx
  601. //
  602. this.lblHeightPx.AutoSize = true;
  603. this.lblHeightPx.Location = new System.Drawing.Point(222, 25);
  604. this.lblHeightPx.Name = "lblHeightPx";
  605. this.lblHeightPx.Size = new System.Drawing.Size(41, 12);
  606. this.lblHeightPx.TabIndex = 0;
  607. this.lblHeightPx.Text = "Height";
  608. //
  609. // groupBox5
  610. //
  611. this.groupBox5.Controls.Add(this.lblPixelWidth);
  612. this.groupBox5.Controls.Add(this.lblPixelHeight);
  613. this.groupBox5.Controls.Add(this.lblWidthPx);
  614. this.groupBox5.Controls.Add(this.lblHeightPx);
  615. this.groupBox5.Controls.Add(this.lblPixelHeightUnit);
  616. this.groupBox5.Controls.Add(this.label7);
  617. this.groupBox5.Dock = System.Windows.Forms.DockStyle.Fill;
  618. this.groupBox5.Location = new System.Drawing.Point(3, 159);
  619. this.groupBox5.Name = "groupBox5";
  620. this.groupBox5.Size = new System.Drawing.Size(424, 46);
  621. this.groupBox5.TabIndex = 5;
  622. this.groupBox5.TabStop = false;
  623. this.groupBox5.Text = "视觉大小";
  624. //
  625. // lblPixelWidth
  626. //
  627. this.lblPixelWidth.Location = new System.Drawing.Point(60, 25);
  628. this.lblPixelWidth.Name = "lblPixelWidth";
  629. this.lblPixelWidth.Size = new System.Drawing.Size(111, 10);
  630. this.lblPixelWidth.TabIndex = 13;
  631. this.lblPixelWidth.Text = "133";
  632. this.lblPixelWidth.TextAlign = System.Drawing.ContentAlignment.TopRight;
  633. //
  634. // lblPixelHeight
  635. //
  636. this.lblPixelHeight.Location = new System.Drawing.Point(273, 25);
  637. this.lblPixelHeight.Name = "lblPixelHeight";
  638. this.lblPixelHeight.Size = new System.Drawing.Size(113, 12);
  639. this.lblPixelHeight.TabIndex = 12;
  640. this.lblPixelHeight.Text = "sdfasdf";
  641. this.lblPixelHeight.TextAlign = System.Drawing.ContentAlignment.TopRight;
  642. //
  643. // lblWidthPx
  644. //
  645. this.lblWidthPx.AutoSize = true;
  646. this.lblWidthPx.Location = new System.Drawing.Point(9, 25);
  647. this.lblWidthPx.Name = "lblWidthPx";
  648. this.lblWidthPx.Size = new System.Drawing.Size(29, 12);
  649. this.lblWidthPx.TabIndex = 11;
  650. this.lblWidthPx.Text = "宽度";
  651. //
  652. // lblPixelHeightUnit
  653. //
  654. this.lblPixelHeightUnit.AutoSize = true;
  655. this.lblPixelHeightUnit.Location = new System.Drawing.Point(388, 25);
  656. this.lblPixelHeightUnit.Name = "lblPixelHeightUnit";
  657. this.lblPixelHeightUnit.Size = new System.Drawing.Size(17, 12);
  658. this.lblPixelHeightUnit.TabIndex = 13;
  659. this.lblPixelHeightUnit.Text = "px";
  660. //
  661. // label7
  662. //
  663. this.label7.AutoSize = true;
  664. this.label7.Location = new System.Drawing.Point(174, 25);
  665. this.label7.Name = "label7";
  666. this.label7.Size = new System.Drawing.Size(17, 12);
  667. this.label7.TabIndex = 13;
  668. this.label7.Text = "px";
  669. //
  670. // groupBox6
  671. //
  672. this.groupBox6.Controls.Add(this.nudCenterY);
  673. this.groupBox6.Controls.Add(this.nudCenterX);
  674. this.groupBox6.Controls.Add(this.label5);
  675. this.groupBox6.Controls.Add(this.label6);
  676. this.groupBox6.Controls.Add(this.label9);
  677. this.groupBox6.Controls.Add(this.label10);
  678. this.groupBox6.Dock = System.Windows.Forms.DockStyle.Fill;
  679. this.groupBox6.Location = new System.Drawing.Point(3, 211);
  680. this.groupBox6.Name = "groupBox6";
  681. this.groupBox6.Size = new System.Drawing.Size(424, 49);
  682. this.groupBox6.TabIndex = 6;
  683. this.groupBox6.TabStop = false;
  684. this.groupBox6.Text = "位置";
  685. //
  686. // nudCenterY
  687. //
  688. this.nudCenterY.Location = new System.Drawing.Point(275, 23);
  689. this.nudCenterY.Name = "nudCenterY";
  690. this.nudCenterY.Size = new System.Drawing.Size(111, 21);
  691. this.nudCenterY.TabIndex = 12;
  692. this.nudCenterY.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
  693. this.nudCenterY.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.nudCenterX_KeyPress);
  694. //
  695. // nudCenterX
  696. //
  697. this.nudCenterX.Location = new System.Drawing.Point(60, 23);
  698. this.nudCenterX.Name = "nudCenterX";
  699. this.nudCenterX.Size = new System.Drawing.Size(111, 21);
  700. this.nudCenterX.TabIndex = 11;
  701. this.nudCenterX.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
  702. this.nudCenterX.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.nudCenterX_KeyPress);
  703. //
  704. // label5
  705. //
  706. this.label5.AutoSize = true;
  707. this.label5.Location = new System.Drawing.Point(222, 27);
  708. this.label5.Name = "label5";
  709. this.label5.Size = new System.Drawing.Size(47, 12);
  710. this.label5.TabIndex = 11;
  711. this.label5.Text = "中心点Y";
  712. //
  713. // label6
  714. //
  715. this.label6.AutoSize = true;
  716. this.label6.Location = new System.Drawing.Point(7, 27);
  717. this.label6.Name = "label6";
  718. this.label6.Size = new System.Drawing.Size(47, 12);
  719. this.label6.TabIndex = 9;
  720. this.label6.Text = "中心点X";
  721. //
  722. // label9
  723. //
  724. this.label9.AutoSize = true;
  725. this.label9.Location = new System.Drawing.Point(388, 29);
  726. this.label9.Name = "label9";
  727. this.label9.Size = new System.Drawing.Size(17, 12);
  728. this.label9.TabIndex = 13;
  729. this.label9.Text = "px";
  730. //
  731. // label10
  732. //
  733. this.label10.AutoSize = true;
  734. this.label10.Location = new System.Drawing.Point(174, 29);
  735. this.label10.Name = "label10";
  736. this.label10.Size = new System.Drawing.Size(17, 12);
  737. this.label10.TabIndex = 13;
  738. this.label10.Text = "px";
  739. //
  740. // tableLayoutPanel1
  741. //
  742. this.tableLayoutPanel1.ColumnCount = 1;
  743. this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
  744. this.tableLayoutPanel1.Controls.Add(this.groupBox2, 0, 0);
  745. this.tableLayoutPanel1.Controls.Add(this.groupBox6, 0, 4);
  746. this.tableLayoutPanel1.Controls.Add(this.groupBox3, 0, 1);
  747. this.tableLayoutPanel1.Controls.Add(this.groupBox5, 0, 3);
  748. this.tableLayoutPanel1.Controls.Add(this.groupBox4, 0, 2);
  749. this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
  750. this.tableLayoutPanel1.Location = new System.Drawing.Point(8, 8);
  751. this.tableLayoutPanel1.Name = "tableLayoutPanel1";
  752. this.tableLayoutPanel1.RowCount = 5;
  753. this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
  754. this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
  755. this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
  756. this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
  757. this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
  758. this.tableLayoutPanel1.Size = new System.Drawing.Size(430, 263);
  759. this.tableLayoutPanel1.TabIndex = 7;
  760. //
  761. // ChangeViewDialog
  762. //
  763. this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
  764. this.ClientSize = new System.Drawing.Size(446, 279);
  765. this.Controls.Add(this.tableLayoutPanel1);
  766. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
  767. this.MaximumSize = new System.Drawing.Size(462, 318);
  768. this.MinimumSize = new System.Drawing.Size(462, 318);
  769. this.Name = "ChangeViewDialog";
  770. this.Padding = new System.Windows.Forms.Padding(8);
  771. this.Text = "修改视场";
  772. this.Controls.SetChildIndex(this.tableLayoutPanel1, 0);
  773. this.groupBox2.ResumeLayout(false);
  774. this.groupBox2.PerformLayout();
  775. this.groupBox3.ResumeLayout(false);
  776. this.groupBox3.PerformLayout();
  777. this.groupBox4.ResumeLayout(false);
  778. this.groupBox4.PerformLayout();
  779. this.groupBox5.ResumeLayout(false);
  780. this.groupBox5.PerformLayout();
  781. this.groupBox6.ResumeLayout(false);
  782. this.groupBox6.PerformLayout();
  783. this.tableLayoutPanel1.ResumeLayout(false);
  784. this.ResumeLayout(false);
  785. }
  786. #region 控件
  787. private GroupBox groupBox2;
  788. private Label label1;
  789. private GroupBox groupBox3;
  790. private GroupBox groupBox4;
  791. private GroupBox groupBox5;
  792. private GroupBox groupBox6;
  793. private Label label2;
  794. private Label lblHeightPx;
  795. private Label lblWidth;
  796. private Label label5;
  797. private Label label6;
  798. private Label lblWidthPx;
  799. private Label lblHeight;
  800. private TextBox nudActualHeight;
  801. private TextBox nudActualWidth;
  802. private TextBox nudCenterX;
  803. private TextBox nudCenterY;
  804. private Label lblPixelWidth;
  805. private Label lblPixelHeight;
  806. private TableLayoutPanel tableLayoutPanel1;
  807. private Label label3;
  808. private Label label4;
  809. private Label lblPixelHeightUnit;
  810. private Label label7;
  811. private Label label9;
  812. private Label label10;
  813. #endregion
  814. }
  815. }