patrick
2019-12-10 1c4426810c71eead57084be8a18ade8d314dd8c4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using Bro.Common.Base;
using HalconDotNet;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
 
namespace Bro.Device.Station.Forms
{
    public partial class OfflineImageFrm : Form
    {
        public HObject HImg { get; set; }
 
        public OfflineImageFrm()
        {
            InitializeComponent();
            HImg?.Dispose();
            HImg = null;
        }
 
        private void OfflineImageFrm_Load(object sender, EventArgs e)
        {
            canvas1.IsShowElementList = false;
        }
 
        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }
 
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            if (canvas1.MAP == null)
            {
                MessageBox.Show("未载入离线图片");
                return;
            }
 
            HImg = new HImage(canvas1.ImageFilePath);
 
            this.DialogResult = DialogResult.OK;
        }
    }
}