革博士V2程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
3.1 KiB

  1. using GeBoShi.SysCtrl;
  2. using Models;
  3. using OpenCvSharp.Extensions;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.ComponentModel;
  7. using System.Data;
  8. using System.Drawing;
  9. using System.Linq;
  10. using System.Text;
  11. using System.Threading.Tasks;
  12. using System.Windows.Forms;
  13. namespace GeBoShi.UI.InageShow
  14. {
  15. public partial class ImageShowFrm : Form
  16. {
  17. private List<DefectInfo> list;
  18. public List<DefectInfo> lstDel = new List<DefectInfo>();
  19. public ImageShowFrm(int imgindex, List<DefectInfo> lst, Image pic)
  20. {
  21. InitializeComponent();
  22. this.uiTitel1.FatherForm = this;
  23. this.uiTitel1.ShowContrlBox(false, false, true, false);
  24. UIStyle.SetUIStyle(this);
  25. this.pictureBox1.Image = pic;
  26. this.BackColor = SystemColors.ControlLightLight ;
  27. list = lst;
  28. }
  29. private void init()
  30. {
  31. SysMgr.Instance.LogMeg($"判断弹窗,原图索引({list[0].PhotoIndex})");
  32. this.label1.Text = $" 原图索引({list[0].PhotoIndex})";
  33. this.Text += $" 原图索引({list[0].PhotoIndex})";
  34. list.ForEach(item => {
  35. OpenCvSharp.Mat img = item.image;
  36. defectLabelImage userCon = new defectLabelImage()
  37. {
  38. Code = item.Code,
  39. Tag = item,
  40. DefecLocation = $"[{item.CentreX}cm,{Math.Round(item.CentreY / 100.0f, 2)}米]",
  41. Image = img
  42. };
  43. //userCon.CodeChangeEvent = (code, name) =>
  44. //{
  45. // item.Code = code;
  46. // item.Name = name;
  47. // API.OutputDebugString("BBBBBBBBBBB-" + item.Code+" "+ item.Name);
  48. //};
  49. this.flowLayoutPanel1.Controls.Add(userCon);
  50. });
  51. }
  52. private void btnOK_Click(object sender, EventArgs e)
  53. {
  54. for (int i = 0; i < this.flowLayoutPanel1.Controls.Count; i++)
  55. {
  56. defectLabelImage userCon = this.flowLayoutPanel1.Controls[i] as defectLabelImage;
  57. if (userCon.Checked)
  58. {
  59. var item = (DefectInfo)userCon.Tag;
  60. lstDel.Add(item);
  61. list.Remove(item);
  62. }
  63. }
  64. this.DialogResult = DialogResult.OK;
  65. this.Close();
  66. }
  67. private void btnSkip_Click(object sender, EventArgs e)
  68. {
  69. for (int i = 0; i < this.flowLayoutPanel1.Controls.Count; i++)
  70. {
  71. defectLabelImage userCon = this.flowLayoutPanel1.Controls[i] as defectLabelImage;
  72. var item = (DefectInfo)userCon.Tag;
  73. lstDel.Add(item);
  74. list.Remove(item);
  75. }
  76. this.DialogResult = DialogResult.OK;
  77. this.Close();
  78. }
  79. private void ImageShowFrm_Load(object sender, EventArgs e)
  80. {
  81. init();
  82. }
  83. }
  84. }