Halcon读取图片

1.打开对话框读取单张图

dev_open_file_dialog

2.图像显示不全

解决方案: HOperatorSet.SetPart(HTuple windowHandle, HTuple row1, HTuple column1, HTuple row2, HTuple column2)

windowHandle:窗体

HTuple row1, HTuple column1,:左上角的行列坐标

HTuple row2, HTuple column2:右下角的行列坐标

hv_Width.Dispose(); hv_Height.Dispose();

HOperatorSet.GetImageSize(ho_Image, out hv_Width, out hv_Height);//获取图像的宽高

//显示**所在区域

HOperatorSet.SetDraw(hWindowControl1.HalconWindow, "margin");

HOperatorSet.SetLineWidth(hWindowControl1.HalconWindow, 3);

HOperatorSet.SetPart(hWindowControl1.HalconWindow, 0, 0, hv_Width, hv_Height);

效果:

相关推荐
csdn_aspnet3 小时前
C# .NetCore Swagger ISchemaFilter 注入示例值、描述
c#·.netcore·swagger
海天鹰3 小时前
C#:object.ShortcutKeys 不支持非功能单独按键
c#
下页、再停留4 小时前
【C#桌面客户端系列学习-10】连接SQLite数据库
数据库·c#·visual studio
RobinDevNotes14 小时前
一套代码发布到十几个平台:Cocos入门速览
typescript·c#·游戏开发
阿松爱学习16 小时前
【Unity开发】监听Scene场景事件
unity·c#
天天代码码天天1 天前
屏幕翻拍满是彩色条纹?用 C# + Vulkan 做了一个去摩尔纹工具,支持单图与文件夹批量
c#·去摩尔纹
2501_930707781 天前
使用C#代码在 Word 文档中添加、插入或删除页面
开发语言·c#·word
淡海水1 天前
03-03-架构篇-SGen GC架构解析
unity·架构·c#·gc·sgen
曹牧2 天前
C#:输入的字符串格式不正确
c#