当前位置:网站首页>文件无法保存(文件夹已损坏无法读取怎么办)
文件无法保存(文件夹已损坏无法读取怎么办)
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
边栏推荐
- 【面试:并发篇25:多线程:volatile】可见性
- Reading the pointpillar code of openpcdet -- Part 3: Calculation of loss function
- C#程序设计的6大原则
- 【面试:并发篇23:多线程:join】join再理解
- PE格式: 分析IatHook并实现
- Blood spitting finishing nanny level series tutorial - playing Fiddler bag capturing tutorial (7) - Fiddler status panel -quickexec command line
- 字节一面:TCP 和 UDP 可以使用同一个端口吗?
- 开源的RSS订阅器FreshRSS
- strcpy()
- 工作面试总遇秒杀? 看了京东 T8 大咖私藏的秒杀系统笔记, 已献出膝盖
猜你喜欢

2022最新软件测试八股文,能不能拿心仪Offer就看你背得怎样了

Optimization analysis of storage structure and IO performance of openharmony littlefs file system

MySQL master-slave configuration

【Redis底层解析】字符串类型

919. Complete binary tree inserter: simple BFS application problem
QT | learn about QT creator by creating a simple project

立创EDA——我为什么要学EDA

919. 完全二叉树插入器 : 简单 BFS 运用题

如何用 Redis 实现分布式锁的?
![[MAIXPY]kpu: load error:2005, ERR_READ_FILE: read file failed问题解决](/img/0b/da67b5a361a2cdfaf81568d34cf5f7.png)
[MAIXPY]kpu: load error:2005, ERR_READ_FILE: read file failed问题解决
随机推荐
IJCAI2022开会了! 微软等《领域泛化Domain Generalization》教程
Experience sharing of system architecture designers preparing for the exam: from point to surface
How to configure and use rocksdb in the flinksql environment
[redis underlying parsing] linked list type
I/o case practice
How to solve the problem of high concurrency and large traffic with PHP
MPI learning notes (II): two implementation methods of matrix multiplication
零基础学习CANoe Panel(17)—— Panel CAPL Function
Is there any document for synchronizing from Oracle to ODPs?
立创EDA——器件的创建01-电阻(二)
[MAIXPY]kpu: load error:2005, ERR_READ_FILE: read file failed问题解决
mysql8.0 mha实现高可用《mha》
[database] conceptual design, logical design, relational database design theory
redis主从架构锁失效问题(主从)
I'm also drunk. Eureka delayed registration and this pit!
Shopify sellers: share some tips for social media marketing!
How to implement distributed locks with redis?
[introduction to C language] zzulioj 1016-1020
Configuration and use of multithreading
How to choose sentinel vs. hystrix current limiting?