基本信息
源码名称:c#+halcon+vs读取图片示例源码
源码大小:0.73M
文件格式:.zip
开发语言:C#
更新时间:2020-04-09
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559

本次赞助数额为: 2 元 
   源码介绍
简单的读取图片

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using HalconDotNet;
namespace _0408简单读取
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        public partial class HDevelopExport
        {
            public HTuple hv_ExpDefaultWinHandle;

            // Main procedure 
            private void action()
            {


                // Local iconic variables 

                HObject ho_image;

                // Local control variables 

                HTuple hv_Width = new HTuple(), hv_Height = new HTuple();
                // Initialize local and output iconic variables 
                HOperatorSet.GenEmptyObj(out ho_image);
                //dev_close_window(...);
                ho_image.Dispose();
                HOperatorSet.ReadImage(out ho_image, "C:/Users/Administrator/Desktop/sad.jpg");
                hv_Width.Dispose(); hv_Height.Dispose();
                HOperatorSet.GetImageSize(ho_image, out hv_Width, out hv_Height);
                //dev_open_window(...);
                HOperatorSet.DispObj(ho_image, hv_ExpDefaultWinHandle);

                ho_image.Dispose();

                hv_Width.Dispose();
                hv_Height.Dispose();
              //  hv_WindowHandle.Dispose();

            }

            public void InitHalcon()
            {
                // Default settings used in HDevelop
                HOperatorSet.SetSystem("width", 512);
                HOperatorSet.SetSystem("height", 512);
            }

            public void RunHalcon(HTuple Window)
            {
                hv_ExpDefaultWinHandle = Window;
                action();
            }

        }
        private void button1_Click(object sender, EventArgs e)
        {

            HDevelopExport HD = new HDevelopExport();
            HD.RunHalcon(hWindowControl1.HalconWindow);

        }
    }
}