当前位置:网站首页>文件无法保存(文件夹已损坏无法读取怎么办)
文件无法保存(文件夹已损坏无法读取怎么办)
2022-07-25 21:43:00 【全栈程序员站长】
大家好,又见面了,我是你们的朋友全栈君。
要使用EmguCV,首先需要去官网下载安装包(除了下载安装包,还有其他几种方式)。安装完成后,得配置环境变量。这里不再赘述。网上的教程很多。我这里分享一个官网的下载链接:https://sourceforge.net/projects/emgucv/files/emgucv/
这里使用窗体程序进行说明,首先新建个窗体
1.引用EmguCV的DLL:using Emgu.CV;using Emgu.CV.Structure;
把Emgu.CV.UI这个类库拖到工具箱中,这样,我们就可以使用他的控件了。往窗体上拖一个imageBox控件(EmguCV控件而不是.NET控件)两个按钮(普通按钮)。
窗体完整代码如下:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Mat img;
private void btnRead_Click(object sender, EventArgs e)
{
//方式一
img = CvInvoke.Imread("1000.jpg");
CvInvoke.Imshow("img", img);
CvInvoke.WaitKey(0);
//方式二
//Image<Bgr, Byte> img = new Image<Bgr, byte>("aa.jpg");//从文件加载图片
//imageBox1.Image = img;
}
private void btnSave_Click(object sender, EventArgs e)
{
//方式一
CvInvoke.Imwrite("new.jpg", img);
MessageBox.Show("保存成功");
//方式二
//imageBox1.Image.Save(@"D:\new.jpg");
}我使用了两种方式进行读取和保存。但是只有方法一可以正常运行。第二种方式程序在 imageBox1.Image = img;这句话卡死了。我目前还没找到原因。但是第二种方式亲测可用。
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/127918.html原文链接:https://javaforall.cn
边栏推荐
- [redis underlying parsing] string type
- What are the application characteristics of NTU general database gbase Bi?
- [interview: concurrent Article 23: multithreading: Join] re understanding of join
- How to solve the problem of high concurrency and large traffic with PHP
- ag 搜索工具参数详解
- PHP zero time task, PHP laravel time task schedule [dry goods]
- Interviewer of large factory: how to quickly query a table with tens of millions of data?
- 大厂面试官:千万级数据量的表,如何进行快速查询?
- Why do independent sellers like to do e-mail marketing? The original conversion rate can be improved so much!
- es6--解构赋值
猜你喜欢

FAW red flag "King fried" is listed, which is safe and comfortable

GPON introduction and Huawei OLT gateway registration and configuration process
![[database] conceptual design, logical design, relational database design theory](/img/4d/be7ab21c98fc1bf4b63e4abe22d9fc.png)
[database] conceptual design, logical design, relational database design theory

I'm also drunk. Eureka delayed registration and this pit!

【leetcode天梯】链表 · 021 合并两个有序链表

NVIDIA has opened source a comprehensive library of 3D deep learning based on pytorch
QT | learn about QT creator by creating a simple project

CNN structural design skills: taking into account speed accuracy and engineering implementation

How to solve the problem of high concurrency and large traffic with PHP

Vivo official website app full model UI adaptation scheme
随机推荐
【面试:并发篇25:多线程:volatile】可见性
Performance debugging -- chrome performance
Why do independent sellers like to do e-mail marketing? The original conversion rate can be improved so much!
【饭谈】那些看似为公司着想,实际却很自私的故事 (一:造轮子)
【Flink】FLink RocksDBListState 报错 You cannot add null to a ListState
Excuse me, how to deal with repeated consumption of MySQL data
mysql8.0 mha实现高可用《mha》
【饭谈】软件测试薪资层次和分段(修仙)
Vivo official website app full model UI adaptation scheme
【测开方法论】测开平台pk心得-抉择
【饭谈】Web3.0到来后,测试人员该何去何从?(十条预言和建议)
Detailed explanation of several ideas for implementing timed tasks in PHP
Apple estimates that iPhone will give up the Chinese market, and the Chinese industrial chain needs to consider living a hard life
How to choose sentinel vs. hystrix current limiting?
Autojs learning - realize 3D perspective
Automatic assembly and fuse degradation of feign
【Redis底层解析】链表类型
少儿编程 电子学会图形化编程等级考试Scratch一级真题解析(判断题)2022年6月
Blood spitting finishing nanny level series tutorial - playing Fiddler bag capturing tutorial (7) - Fiddler status panel -quickexec command line
Oracle RAC RMAN backup error ora-19501 ora-15081