BitmapAnalysisDialog.cs 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754
  1. using OpenCvSharp;
  2. using PaintDotNet.Base.CommTool;
  3. using PaintDotNet.DbOpreate.DbBll;
  4. using PaintDotNet.DbOpreate.DbModel;
  5. using System;
  6. using System.Data;
  7. using System.Drawing;
  8. using System.IO;
  9. using System.Windows.Forms;
  10. using System.Windows.Forms.VisualStyles;
  11. /// <summary>
  12. /// 位图分析
  13. /// </summary>
  14. namespace PaintDotNet.Measuring
  15. {
  16. partial class BitmapAnalysisDialog : Form
  17. {
  18. /// <summary>
  19. /// 主控件
  20. /// </summary>
  21. private AppWorkspace appWorkspace;
  22. /// <summary>
  23. /// 画布
  24. /// </summary>
  25. private PanelEx panel;
  26. /// <summary>
  27. /// 图像mat
  28. /// </summary>
  29. private Mat mat;
  30. /// <summary>
  31. /// 单元格宽度
  32. /// </summary>
  33. private int unitWidth = 50;
  34. /// <summary>
  35. /// 单元格高度
  36. /// </summary>
  37. private int unitHeight = 20;
  38. private HScrollBar hScrollBar1;
  39. private VScrollBar vScrollBar1;
  40. private int num = 3;
  41. private decimal oldNumValue = 0;
  42. /// <summary>
  43. /// 画笔
  44. /// </summary>
  45. private Pen pen = new Pen(Color.Black);
  46. public BitmapAnalysisDialog(AppWorkspace appWorkspace)
  47. {
  48. this.appWorkspace = appWorkspace;
  49. this.InitializeComponent();
  50. InitializeLanguageText();
  51. this.InitializeControl();
  52. }
  53. private void InitializeControl()
  54. {
  55. if (this.appWorkspace.ActiveDocumentWorkspace != null)
  56. {
  57. mat = PaintDotNet.Camera.Tools.ToMat(
  58. this.appWorkspace.ActiveDocumentWorkspace.CompositionSurface.CreateAliasedBitmap());
  59. }
  60. if(mat != null)
  61. {
  62. this.panel = new PanelEx();
  63. this.panel.Location = new System.Drawing.Point(0, 0);
  64. this.panel.Size = this.panel1.ClientSize;
  65. this.panel.Paint += this.panel_Paint;
  66. this.panel.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom;
  67. this.panel1.Controls.Add(this.panel);
  68. this.hScrollBar1.Maximum = (mat.Width + 1) * unitWidth * num - this.panel1.ClientSize.Width + unitWidth;
  69. this.vScrollBar1.Maximum = (mat.Height + 2) * unitHeight - this.panel1.ClientSize.Height;
  70. if (mat.Type() == MatType.CV_8UC1)
  71. {
  72. this.hScrollBar1.LargeChange = unitWidth;
  73. this.hScrollBar1.SmallChange = unitWidth;
  74. }
  75. else
  76. {
  77. this.hScrollBar1.LargeChange = 3 * unitWidth;
  78. this.hScrollBar1.SmallChange = 3 * unitWidth;
  79. }
  80. this.vScrollBar1.LargeChange = unitHeight;
  81. this.vScrollBar1.SmallChange = unitHeight;
  82. this.hScrollBar1.Scroll += this.panel1_Scroll;
  83. this.vScrollBar1.Scroll += this.panel1_Scroll;
  84. }
  85. else
  86. {
  87. return;
  88. }
  89. }
  90. private void panel1_MouseWheel(object sender, MouseEventArgs e)
  91. {
  92. this.panel.Location = new System.Drawing.Point(0, 0);
  93. this.panel.Refresh();
  94. }
  95. private void panel1_Scroll(object sender, ScrollEventArgs e)
  96. {
  97. this.panel.Location = new System.Drawing.Point(0, 0);
  98. this.panel.Refresh();
  99. }
  100. private void panel1_Resize(object sender, EventArgs e)
  101. {
  102. if (this.panel1 != null && mat!=null)
  103. {
  104. this.hScrollBar1.Maximum = (mat.Width + 1) * unitWidth * num - this.panel1.ClientSize.Width + 50;
  105. this.vScrollBar1.Maximum = (mat.Height + 2) * unitHeight - this.panel1.ClientSize.Height;
  106. this.panel.Size = this.panel1.ClientSize;
  107. this.panel.Location = new System.Drawing.Point(0, 0);
  108. this.panel.Refresh();
  109. }
  110. }
  111. private void panel_Paint(object sender, PaintEventArgs e)
  112. {
  113. //计算起止数据
  114. int h_s_index = Math.Abs(this.hScrollBar1.Value / unitWidth / num);
  115. int v_s_index = Math.Abs(this.vScrollBar1.Value / unitHeight);
  116. int h_e_index = 0;
  117. if (this.oldNumValue > 1)
  118. h_e_index = h_s_index + this.panel1.ClientSize.Width * (int)this.oldNumValue / unitWidth / num;
  119. else
  120. h_e_index = h_s_index + this.panel1.ClientSize.Width / unitWidth / num;
  121. int v_e_index = 0;
  122. if (this.oldNumValue > 1)
  123. v_e_index = v_s_index + this.panel1.ClientSize.Height * (int)this.oldNumValue / unitHeight;
  124. else
  125. v_e_index = v_s_index + this.panel1.ClientSize.Height / unitHeight;
  126. Vec3b vec3B = new Vec3b();
  127. int v1 = 1;
  128. int v2 = 1;
  129. int v3 = v_s_index;
  130. for (int v = v_s_index; v < v_e_index; v++)
  131. {
  132. int h1 = 1;
  133. if(v1 == 1)
  134. {
  135. e.Graphics.DrawRectangle(pen, new Rectangle(0, 0, unitWidth, unitHeight));
  136. e.Graphics.DrawString("Pixel", new Font("Microsoft Sans Serif", 12), new SolidBrush(Color.Red), 0, 0);
  137. }
  138. if (this.oldNumValue > 1)
  139. {
  140. if ((v1 - 1 + v_s_index) % this.oldNumValue == 0)
  141. {
  142. if (v < mat.Height)
  143. {
  144. e.Graphics.DrawRectangle(pen, new Rectangle(0, v2 * unitHeight, unitWidth, unitHeight));
  145. e.Graphics.DrawString((v1 - 1 + v_s_index) + "", new Font("Microsoft Sans Serif", 12), new SolidBrush(Color.Black), 0, v2 * unitHeight);
  146. }
  147. for (int h = h_s_index; h < h_e_index; h++)
  148. {
  149. if (mat.Type() == MatType.CV_8UC1)
  150. {
  151. if (h < mat.Width && v < mat.Height)
  152. {
  153. if (h % this.oldNumValue == 0)
  154. {
  155. if (v3 == v_s_index)
  156. {
  157. e.Graphics.DrawRectangle(pen, new Rectangle(h1 * unitWidth, 0, unitWidth, unitHeight));
  158. e.Graphics.DrawString(h + "", new Font("Microsoft Sans Serif", 12), new SolidBrush(Color.Black), h1 * unitWidth, 0);
  159. }
  160. e.Graphics.DrawString("" + mat.At<byte>(v, h), new Font("Microsoft Sans Serif", 12), new SolidBrush(Color.Black), h1 * unitWidth, v2 * unitHeight);
  161. e.Graphics.DrawRectangle(pen, new Rectangle(h1 * unitWidth, 0, h1 * unitWidth, v2 * unitHeight));
  162. h1++;
  163. }
  164. }
  165. }
  166. else
  167. {
  168. if (h < mat.Width && v < mat.Height)
  169. {
  170. if(h % this.oldNumValue == 0)
  171. {
  172. if (v3 == v_s_index)
  173. {
  174. e.Graphics.DrawRectangle(pen, new Rectangle(h1 * unitWidth, 0, unitWidth, unitHeight));
  175. e.Graphics.DrawRectangle(pen, new Rectangle((h1 + 1) * unitWidth, 0, unitWidth, unitHeight));
  176. e.Graphics.DrawRectangle(pen, new Rectangle((h1 + 2) * unitWidth, 0, unitWidth, unitHeight));
  177. e.Graphics.DrawString(h + "", new Font("Microsoft Sans Serif", 12), new SolidBrush(Color.Black), (h1 + 2) * unitWidth, 0);
  178. }
  179. vec3B = mat.At<Vec3b>(v, h);
  180. e.Graphics.DrawString("" + vec3B.Item0, new Font("Microsoft Sans Serif", 12), new SolidBrush(Color.Black), h1 * unitWidth, v2 * unitHeight);
  181. e.Graphics.DrawString("" + vec3B.Item1, new Font("Microsoft Sans Serif", 12), new SolidBrush(Color.Black), (h1 + 1) * unitWidth, v2 * unitHeight);
  182. e.Graphics.DrawString("" + vec3B.Item2, new Font("Microsoft Sans Serif", 12), new SolidBrush(Color.Black), (h1 + 2) * unitWidth, v2 * unitHeight);
  183. e.Graphics.DrawRectangle(pen, new Rectangle(h1 * unitWidth, v2 * unitHeight, unitWidth, unitHeight));
  184. e.Graphics.DrawRectangle(pen, new Rectangle((h1 + 1) * unitWidth, v2 * unitHeight, unitWidth, unitHeight));
  185. e.Graphics.DrawRectangle(pen, new Rectangle((h1 + 2) * unitWidth, v2 * unitHeight, unitWidth, unitHeight));
  186. h1 = h1 + 3;
  187. }
  188. }
  189. }
  190. }
  191. v2++;
  192. v3++;
  193. }
  194. }
  195. else
  196. {
  197. if (v < mat.Height)
  198. {
  199. e.Graphics.DrawRectangle(pen, new Rectangle(0, v1 * unitHeight, unitWidth, unitHeight));
  200. e.Graphics.DrawString((v1 - 1 + v_s_index) + "", new Font("Microsoft Sans Serif", 12), new SolidBrush(Color.Black), 0, v1 * unitHeight);
  201. }
  202. for (int h = h_s_index; h < h_e_index; h++)
  203. {
  204. if (mat.Type() == MatType.CV_8UC1)
  205. {
  206. if (h < mat.Width && v < mat.Height)
  207. {
  208. e.Graphics.DrawString("" + mat.At<byte>(v, h), new Font("Microsoft Sans Serif", 12), new SolidBrush(Color.Black), h1 * unitWidth, v1 * unitHeight);
  209. e.Graphics.DrawRectangle(pen, new Rectangle(h1 * unitWidth, v1 * unitHeight, unitWidth, unitHeight));
  210. h1++;
  211. }
  212. }
  213. else
  214. {
  215. if (h < mat.Width && v < mat.Height)
  216. {
  217. if (v == v_s_index)
  218. {
  219. e.Graphics.DrawRectangle(pen, new Rectangle(h1 * unitWidth, 0, unitWidth, unitHeight));
  220. e.Graphics.DrawRectangle(pen, new Rectangle((h1 + 1) * unitWidth, 0, unitWidth, unitHeight));
  221. e.Graphics.DrawRectangle(pen, new Rectangle((h1 + 2) * unitWidth, 0, unitWidth, unitHeight));
  222. e.Graphics.DrawString(h + "", new Font("Microsoft Sans Serif", 12), new SolidBrush(Color.Black), (h1 + 2) * unitWidth, 0);
  223. }
  224. vec3B = mat.At<Vec3b>(v, h);
  225. e.Graphics.DrawString("" + vec3B.Item0, new Font("Microsoft Sans Serif", 12), new SolidBrush(Color.Black), h1 * unitWidth, v1 * unitHeight);
  226. e.Graphics.DrawString("" + vec3B.Item1, new Font("Microsoft Sans Serif", 12), new SolidBrush(Color.Black), (h1 + 1) * unitWidth, v1 * unitHeight);
  227. e.Graphics.DrawString("" + vec3B.Item2, new Font("Microsoft Sans Serif", 12), new SolidBrush(Color.Black), (h1 + 2) * unitWidth, v1 * unitHeight);
  228. e.Graphics.DrawRectangle(pen, new Rectangle(h1 * unitWidth, v1 * unitHeight, unitWidth, unitHeight));
  229. e.Graphics.DrawRectangle(pen, new Rectangle((h1 + 1) * unitWidth, v1 * unitHeight, unitWidth, unitHeight));
  230. e.Graphics.DrawRectangle(pen, new Rectangle((h1 + 2) * unitWidth, v1 * unitHeight, unitWidth, unitHeight));
  231. }
  232. h1 = h1 + 3;
  233. }
  234. }
  235. }
  236. v1++;
  237. }
  238. }
  239. /// <summary>
  240. /// 数据导出按钮按下
  241. /// </summary>
  242. /// <param name="sender"></param>
  243. /// <param name="e"></param>
  244. private void button2_Click(object sender, EventArgs e)
  245. {
  246. if(mat!=null)
  247. {
  248. if (mat.Width > 1500 && mat.Height > 1500)
  249. MessageBox.Show(PdnResources.GetString("Menu.Thepictureistoolarge.Text")+"!");
  250. else
  251. this.OutPutExcel();
  252. }
  253. }
  254. /// <summary>
  255. /// 确认按钮按下
  256. /// </summary>
  257. /// <param name="sender"></param>
  258. /// <param name="e"></param>
  259. private void button1_Click(object sender, EventArgs e)
  260. {
  261. if(this.panel!=null)
  262. {
  263. this.oldNumValue = this.numericUpDown1.Value;
  264. this.panel.Location = new System.Drawing.Point(0, 0);
  265. this.panel.Refresh();
  266. }
  267. }
  268. /// <summary>
  269. /// Excel导出
  270. /// </summary>
  271. private void OutPutExcel()
  272. {
  273. string fileName = DateTime.Now.ToString("yyyyMMddhhmmss") + PdnResources.GetString("Menu.Statisticaldattable.Text");
  274. SaveFileDialog exe = new SaveFileDialog();
  275. exe.Filter = "Execl files (*.xls)|*.xls";
  276. exe.FilterIndex = 0;
  277. exe.RestoreDirectory = true;
  278. exe.Title = "Export Excel File";
  279. exe.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
  280. exe.FileName = fileName;
  281. DialogResult dr = exe.ShowDialog();
  282. if (dr != DialogResult.OK)
  283. {
  284. return;
  285. }
  286. ProgressThreadProcClass procClass = new ProgressThreadProcClass();
  287. System.Threading.ThreadStart copyThreadProc =
  288. delegate ()
  289. {
  290. bool isNeedZoom;//是否需要缩放
  291. int dotPitch = Startup.instance.configModel.DotPitchId;//获取系统激活的点距id
  292. double pointPitch = 0;
  293. if (dotPitch > 0)
  294. {
  295. mic_screen_rules screenList = mic_screen_rules_BLL.FindDefault(dotPitch);//从数据库查询点距具体信息
  296. if (screenList != null)
  297. {
  298. try
  299. {
  300. pointPitch = double.Parse(screenList.point_pitch);//获取点距
  301. if (pointPitch > 0)
  302. isNeedZoom = true;
  303. }
  304. catch (System.Exception)
  305. {
  306. }
  307. }
  308. }
  309. try
  310. {
  311. DataTable dtb = new DataTable();
  312. Vec3b vec3B = new Vec3b();
  313. bool a = true;
  314. if (mat.Type() == MatType.CV_8UC1)
  315. {
  316. for (int i = 0; i <= mat.Width; i++)
  317. {
  318. if (this.oldNumValue > 1)
  319. {
  320. if (i % this.oldNumValue == 0)
  321. {
  322. if (i == 0)
  323. dtb.Columns.Add("one");
  324. dtb.Columns.Add(i.ToString());
  325. }
  326. }
  327. else
  328. {
  329. if (i == 0)
  330. dtb.Columns.Add("one");
  331. dtb.Columns.Add(i.ToString());
  332. }
  333. }
  334. int height;
  335. if (this.oldNumValue > 1)
  336. height = mat.Height + (int)this.oldNumValue;
  337. else
  338. height = mat.Height + 1;
  339. for (int i = 0; i < height; i++)
  340. {
  341. DataRow dataRow = dtb.NewRow();
  342. for (int j = 0; j < mat.Width; j++)
  343. {
  344. if (i == 0 && j == 0)
  345. dataRow["one"] = "Pixel";
  346. if (i == 0 && j > 0)
  347. {
  348. if (this.oldNumValue > 1)
  349. {
  350. if (j - this.oldNumValue == 0)
  351. dataRow["0"] = (j - this.oldNumValue).ToString();
  352. if (j % this.oldNumValue == 0)
  353. {
  354. dataRow[j.ToString()] = j.ToString();
  355. }
  356. }
  357. else
  358. {
  359. dataRow["0"] = "0";
  360. dataRow[j.ToString()] = j.ToString();
  361. }
  362. }
  363. if (i > 0 && j == 0)
  364. {
  365. if (this.oldNumValue > 1)
  366. {
  367. if ((i - this.oldNumValue) % this.oldNumValue == 0)
  368. {
  369. dataRow["one"] = (i - this.oldNumValue).ToString();
  370. }
  371. }
  372. else
  373. {
  374. dataRow["one"] = (i - 1).ToString();
  375. }
  376. }
  377. if (i > 0 && j > 0)
  378. {
  379. if (this.oldNumValue > 1)
  380. {
  381. if (i % this.oldNumValue == 0 && j % this.oldNumValue == 0)
  382. {
  383. if (j - this.oldNumValue == 0)
  384. dataRow["0"] = "" + mat.At<byte>(i - (int)this.oldNumValue, 0);
  385. dataRow[j.ToString()] = "" + mat.At<byte>(i - (int)this.oldNumValue, j - (int)this.oldNumValue);
  386. }
  387. }
  388. else
  389. {
  390. if (j == 1)
  391. dataRow["0"] = "" + mat.At<byte>(i - 1, 0);
  392. dataRow[j.ToString()] = "" + mat.At<byte>(i - 1, j - 1);
  393. }
  394. }
  395. }
  396. if (this.oldNumValue > 1)
  397. {
  398. if (i % this.oldNumValue == 0)
  399. {
  400. dtb.Rows.Add(dataRow);
  401. }
  402. }
  403. else
  404. {
  405. dtb.Rows.Add(dataRow);
  406. }
  407. }
  408. }
  409. else
  410. {
  411. for (int i = 0; i <= mat.Width * 3 + 2; i++)
  412. {
  413. if (i == 0)
  414. dtb.Columns.Add("one");
  415. dtb.Columns.Add(i.ToString());
  416. }
  417. int height;
  418. if (this.oldNumValue > 1)
  419. height = mat.Height + (int)this.oldNumValue;
  420. else
  421. height = mat.Height + 1;
  422. for (int i = 0; i < height; i++)
  423. {
  424. DataRow dataRow = dtb.NewRow();
  425. int oneCol = 0;
  426. int oneRow1 = 0;
  427. for (int j = 0; j <= mat.Width * 3; j++)
  428. {
  429. if (i == 0 && j == 0)
  430. dataRow["one"] = "Pixel";
  431. if (i == 0 && j > 0 && oneCol < mat.Width)
  432. {
  433. if (this.oldNumValue > 1)
  434. {
  435. if (oneCol % this.oldNumValue == 0)
  436. {
  437. dataRow[(j + 1).ToString()] = oneCol.ToString();
  438. j = j + 2;
  439. }
  440. else
  441. {
  442. j--;
  443. }
  444. oneCol++;
  445. }
  446. else
  447. {
  448. dataRow[(j + 1).ToString()] = oneCol.ToString();
  449. oneCol++;
  450. j = j + 2;
  451. }
  452. }
  453. if (i > 0 && j == 0)
  454. {
  455. if (this.oldNumValue > 1)
  456. {
  457. if ((i - this.oldNumValue) % this.oldNumValue == 0)
  458. {
  459. dataRow["one"] = (i - this.oldNumValue).ToString();
  460. }
  461. }
  462. else
  463. {
  464. dataRow["one"] = (i - 1).ToString();
  465. }
  466. }
  467. if (i > 0 && j > 0 && oneRow1 <= mat.Width)
  468. {
  469. if (this.oldNumValue > 1)
  470. {
  471. if ((i - this.oldNumValue) % this.oldNumValue == 0 && oneRow1 % this.oldNumValue == 0)
  472. {
  473. if ((i - this.oldNumValue - 1) < mat.Height && oneRow1 < mat.Width)
  474. {
  475. vec3B = mat.At<Vec3b>((int)(i - this.oldNumValue), oneRow1);
  476. dataRow[(j - 1).ToString()] = "" + vec3B.Item0;
  477. dataRow[(j).ToString()] = "" + vec3B.Item1;
  478. dataRow[(j + 1).ToString()] = "" + vec3B.Item2;
  479. j = j + 2;
  480. }
  481. }
  482. else
  483. {
  484. j--;
  485. }
  486. oneRow1++;
  487. }
  488. else
  489. {
  490. if ((i - 1) < mat.Height && (j - 1) < mat.Width * 3)
  491. {
  492. vec3B = mat.At<Vec3b>(i - 1, (j - 1) / 3);
  493. dataRow[(j - 1).ToString()] = "" + vec3B.Item0;
  494. dataRow[(j).ToString()] = "" + vec3B.Item1;
  495. dataRow[(j + 1).ToString()] = "" + vec3B.Item2;
  496. j = j + 2;
  497. }
  498. }
  499. }
  500. }
  501. if (this.oldNumValue > 1)
  502. {
  503. if (i % this.oldNumValue == 0)
  504. {
  505. dtb.Rows.Add(dataRow);
  506. }
  507. }
  508. else
  509. {
  510. dtb.Rows.Add(dataRow);
  511. }
  512. }
  513. }
  514. Stream ms;
  515. ms = exe.OpenFile();
  516. StreamWriter sw = new StreamWriter(ms, System.Text.Encoding.GetEncoding(-0));
  517. try
  518. {
  519. for (int j = 0; j < dtb.Rows.Count; j++)
  520. {
  521. string temp = "";
  522. for (int k = 0; k < dtb.Columns.Count; k++)
  523. {
  524. if (k > 0)
  525. {
  526. temp += "\t";
  527. }
  528. string cell = dtb.Rows[j][k].ToString();
  529. cell = cell.Replace(" ", "").Replace("\r", "").Replace("\n", "").Replace("\r\n", "");
  530. temp += cell;
  531. }
  532. sw.WriteLine(temp);
  533. }
  534. sw.Close();
  535. ms.Close();
  536. }
  537. catch (Exception ex)
  538. {
  539. MessageBox.Show(ex.Message);
  540. return;
  541. }
  542. finally
  543. {
  544. sw.Close();
  545. ms.Close();
  546. }
  547. if(OfficeFileHandleHelper.ConvertWorkbook(exe.FileName, fileName))
  548. {
  549. if (System.IO.File.Exists(exe.FileName))
  550. System.IO.File.Delete(exe.FileName);
  551. }
  552. procClass.DismissProgressAction(this);
  553. }
  554. catch (Exception)
  555. {
  556. }
  557. finally
  558. {
  559. procClass.DismissProgressAction(this);
  560. }
  561. };
  562. procClass.StartProgressAutoAction(this, new System.Threading.ThreadStart(copyThreadProc), PdnResources.GetString("Menu.MeasureAction.BitmapAnalysis.Text"));
  563. }
  564. #region 设计器生成
  565. /// <summary>
  566. /// Required designer variable.
  567. /// </summary>
  568. private System.ComponentModel.IContainer components = null;
  569. /// <summary>
  570. /// Clean up any resources being used.
  571. /// </summary>
  572. /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
  573. protected override void Dispose(bool disposing)
  574. {
  575. if (disposing && (components != null))
  576. {
  577. components.Dispose();
  578. }
  579. base.Dispose(disposing);
  580. }
  581. #region Windows Form Designer generated code
  582. private void InitializeLanguageText()
  583. {
  584. this.groupBox1.Text = PdnResources.GetString("Menu.operation.text");
  585. this.label1.Text = PdnResources.GetString("Menu.Imagement.Bitmapanalysis.Samplingvalue.text") + ":";
  586. this.button2.Text = PdnResources.GetString("Menu.Imagement.Bitmapanalysis.exportdata.text");
  587. this.button1.Text = PdnResources.GetString("Menu.ensure.text");
  588. this.Text = PdnResources.GetString("Menu.MeasureAction.BitmapAnalysis.Text");
  589. }
  590. /// <summary>
  591. /// Required method for Designer support - do not modify
  592. /// the contents of this method with the code editor.
  593. /// </summary>
  594. private void InitializeComponent()
  595. {
  596. this.groupBox1 = new System.Windows.Forms.GroupBox();
  597. this.label1 = new System.Windows.Forms.Label();
  598. this.button2 = new System.Windows.Forms.Button();
  599. this.button1 = new System.Windows.Forms.Button();
  600. this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
  601. this.panel1 = new System.Windows.Forms.Panel();
  602. this.vScrollBar1 = new System.Windows.Forms.VScrollBar();
  603. this.hScrollBar1 = new System.Windows.Forms.HScrollBar();
  604. this.groupBox1.SuspendLayout();
  605. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
  606. this.SuspendLayout();
  607. //
  608. // groupBox1
  609. //
  610. this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  611. | System.Windows.Forms.AnchorStyles.Right)));
  612. this.groupBox1.Controls.Add(this.label1);
  613. this.groupBox1.Controls.Add(this.button2);
  614. this.groupBox1.Controls.Add(this.button1);
  615. this.groupBox1.Controls.Add(this.numericUpDown1);
  616. this.groupBox1.Location = new System.Drawing.Point(3, 5);
  617. this.groupBox1.Name = "groupBox1";
  618. this.groupBox1.Size = new System.Drawing.Size(792, 109);
  619. this.groupBox1.TabIndex = 0;
  620. this.groupBox1.TabStop = false;
  621. //
  622. // label1
  623. //
  624. this.label1.AutoSize = true;
  625. this.label1.ForeColor = System.Drawing.SystemColors.Desktop;
  626. this.label1.Location = new System.Drawing.Point(35, 46);
  627. this.label1.Name = "label1";
  628. this.label1.Size = new System.Drawing.Size(53, 12);
  629. this.label1.TabIndex = 4;
  630. this.label1.Text = "取样值:";
  631. //
  632. // button2
  633. //
  634. this.button2.BackColor = System.Drawing.SystemColors.Control;
  635. this.button2.Location = new System.Drawing.Point(523, 37);
  636. this.button2.Name = "button2";
  637. this.button2.Size = new System.Drawing.Size(105, 31);
  638. this.button2.TabIndex = 3;
  639. this.button2.Text = "导出数据";
  640. this.button2.UseVisualStyleBackColor = false;
  641. this.button2.Click += new System.EventHandler(this.button2_Click);
  642. //
  643. // button1
  644. //
  645. this.button1.BackColor = System.Drawing.SystemColors.Control;
  646. this.button1.Location = new System.Drawing.Point(220, 37);
  647. this.button1.Name = "button1";
  648. this.button1.Size = new System.Drawing.Size(79, 31);
  649. this.button1.TabIndex = 2;
  650. this.button1.Text = "确定";
  651. this.button1.UseVisualStyleBackColor = false;
  652. this.button1.Click += new System.EventHandler(this.button1_Click);
  653. //
  654. // numericUpDown1
  655. //
  656. this.numericUpDown1.Location = new System.Drawing.Point(95, 44);
  657. this.numericUpDown1.Maximum = new decimal(new int[] {
  658. 99999,
  659. 0,
  660. 0,
  661. 0});
  662. this.numericUpDown1.Name = "numericUpDown1";
  663. this.numericUpDown1.Size = new System.Drawing.Size(85, 21);
  664. this.numericUpDown1.TabIndex = 1;
  665. this.numericUpDown1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
  666. //
  667. // panel1
  668. //
  669. this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  670. | System.Windows.Forms.AnchorStyles.Left)
  671. | System.Windows.Forms.AnchorStyles.Right)));
  672. this.panel1.AutoScroll = true;
  673. this.panel1.Location = new System.Drawing.Point(3, 120);
  674. this.panel1.Name = "panel1";
  675. this.panel1.Size = new System.Drawing.Size(774, 538);
  676. this.panel1.TabIndex = 2;
  677. this.panel1.Resize += new System.EventHandler(this.panel1_Resize);
  678. //
  679. // vScrollBar1
  680. //
  681. this.vScrollBar1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  682. | System.Windows.Forms.AnchorStyles.Right)));
  683. this.vScrollBar1.LargeChange = 20;
  684. this.vScrollBar1.Location = new System.Drawing.Point(778, 119);
  685. this.vScrollBar1.Name = "vScrollBar1";
  686. this.vScrollBar1.Size = new System.Drawing.Size(17, 539);
  687. this.vScrollBar1.SmallChange = 20;
  688. this.vScrollBar1.TabIndex = 1;
  689. //
  690. // hScrollBar1
  691. //
  692. this.hScrollBar1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
  693. | System.Windows.Forms.AnchorStyles.Right)));
  694. this.hScrollBar1.LargeChange = 50;
  695. this.hScrollBar1.Location = new System.Drawing.Point(3, 659);
  696. this.hScrollBar1.Name = "hScrollBar1";
  697. this.hScrollBar1.Size = new System.Drawing.Size(773, 18);
  698. this.hScrollBar1.SmallChange = 50;
  699. this.hScrollBar1.TabIndex = 0;
  700. //
  701. // BitmapAnalysisDialog
  702. //
  703. this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
  704. this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
  705. this.BackColor = System.Drawing.SystemColors.Control;
  706. this.ClientSize = new System.Drawing.Size(798, 679);
  707. this.Controls.Add(this.hScrollBar1);
  708. this.Controls.Add(this.vScrollBar1);
  709. this.Controls.Add(this.panel1);
  710. this.Controls.Add(this.groupBox1);
  711. this.Name = "BitmapAnalysisDialog";
  712. this.Text = "位图分析";
  713. this.groupBox1.ResumeLayout(false);
  714. this.groupBox1.PerformLayout();
  715. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
  716. this.ResumeLayout(false);
  717. }
  718. #endregion
  719. private System.Windows.Forms.GroupBox groupBox1;
  720. private System.Windows.Forms.Label label1;
  721. private System.Windows.Forms.Button button2;
  722. private System.Windows.Forms.Button button1;
  723. private System.Windows.Forms.NumericUpDown numericUpDown1;
  724. private System.Windows.Forms.Panel panel1;
  725. #endregion
  726. }
  727. }