当前位置:网站首页>vc hacon 聯合編程 GenImage3Extern WriteImage
vc hacon 聯合編程 GenImage3Extern WriteImage
2022-06-12 19:06:00 【weixin_39926429】
//在以前的文章中描述了聯合編程讀圖,詳見vc halcon 聯合編程的配置 ReadImage demo_weixin_39926429的博客-CSDN博客
//本文描述生成圖片和保存圖片到硬盤。
void NewImage(HObject* pHobj)
{
unsigned char* image_red;
unsigned char* image_green;
unsigned char* image_blue;
int r, c;
image_red = (unsigned char*)malloc(640 * 480);
image_green =( unsigned char*) malloc(640 * 480);
image_blue = (unsigned char*)malloc(640 * 480);
for (r = 0; r < 480; r++)
for (c = 0; c < 640; c++)
{
image_red[r * 640 + c] = c % 255;
image_green[r * 640 + c] = (c + 64) % 255;
image_blue[r * 640 + c] = (c + 128) % 255;
}
//halcon 函數生成圖片
GenImage3Extern(pHobj, "byte", 640, 480, (Hlong)image_red, \
(Hlong)image_green, (Hlong)image_blue, (Hlong)free);
}
main()
{ HObject Image;
NewImage(&Image);
WriteImage(Image, "bmp", 0, "d:\\test1000.bmp");//保存圖片到硬盤
}
//保存的圖片打開後如下

边栏推荐
- What is a network proxy
- PHP converts total seconds to hours, minutes and seconds
- leetcode:5289. 公平分发饼干【看数据范围 + dfs剪枝】
- CVPR 2022 oral Dalian Institute of technology proposed SCI: a fast and powerful low light image enhancement method
- 原生Servlet - 文件的Upload&Download
- The solution of BiliBili video list name too long and incomplete display
- 一种灵活注入 Istio Sidecar 的方案探索
- A fruitful afternoon
- MySQL数据库实验一 数据定义
- 观察网站的页面
猜你喜欢

kali通过iptables实现端口转发功能

vc hacon 联合编程 GenImage3Extern WriteImage

吃饭咯 干锅肥肠 + 掌中宝!

no available service ‘null‘ found, please make sure registry config correct

leetcode:5289. 公平分发饼干【看数据范围 + dfs剪枝】

A journey of database full SQL analysis and audit system performance optimization

In 2021, the global revenue of electro-optical modulator (EOM) is about USD 360.3 million, and it is expected to reach USD 704.4 million in 2028
![leetcode:6094. Company name [group enumeration + cannot repeat set intersection + product Cartesian product (repeat indicates length)]](/img/6c/f42bbec7ff2ec0d104f1dd2c97eab6.png)
leetcode:6094. Company name [group enumeration + cannot repeat set intersection + product Cartesian product (repeat indicates length)]

RT-Thread 模拟器 simulator 搭建 LVGL 的开发调试环境

Transactions in redis
随机推荐
Research Report on the overall scale, major manufacturers, major regions, products and applications of Electric Screwdrivers in the global market in 2022
The solution of BiliBili video list name too long and incomplete display
Research Report on the overall scale, major manufacturers, major regions, products and application segments of lifeboats in the global market in 2022
leetcode:6094. 公司命名【分组枚举 + 不能重复用set交集 + product笛卡儿积(repeat表示长度)】
The Bean Validation API is on the classpath but no implementation could be found
Redis中的事务
Leetcode 1049. 最后一块石头的重量 II
bilibili视频列表名字太长显示不全的解决方法
China's asset management market demand and future competitive trends outlook report 2022-2028
kali通过iptables实现端口转发功能
Cookie & Session & kaptcha驗證碼
Detailed explanation of yolox network structure
leetcode:6097. 替换字符后匹配【set记录 + 相同长度逐一查询】
The 14th five year development plan and investment prospect analysis report of China's oil and gas pipeline engineering construction 2022-2027
国内如何下载ProxyStrike
Kali LAN ARP Spoofing and monitoring other hosts' Internet access records in the LAN
一种灵活注入 Istio Sidecar 的方案探索
Common troubleshooting tools and analysis artifacts are worth collecting
In 2021, the global revenue of electro-optical modulator (EOM) is about USD 360.3 million, and it is expected to reach USD 704.4 million in 2028
Leetcodesql: count the number of students in each major