当前位置:网站首页>C # picture display occupancy problem
C # picture display occupancy problem
2022-07-02 04:51:00 【dancebit】
Control
pictureBox1.Image = Image.FromFile("1.jpg");
No problem in actual use , But the picture will be occupied , Not even delete .
After image assignment pictureBox1 It will not refresh immediately , If released immediately image.Dispose() It will cause the back of the picture pictureBox1 An error is reported when the resource is not found during refresh . So refresh the image control before releasing pictureBox1.Refresh() that will do Release files .
The implementation is as follows :
var image = Image.FromFile("1.jpg");
pictureBox1.Image = image;
pictureBox1.Refresh();
image.Dispose();
边栏推荐
- C language practice - binary search (half search)
- Practical problem solving ability of steam Education
- 缓存一致性解决方案——改数据时如何保证缓存和数据库中数据的一致性
- idea自動導包和自動删包設置
- 数学知识(欧拉函数)
- [graduation season · advanced technology Er] young people have dreams, why are they afraid of hesitation
- What data does the main account of Zhengda Meiou 4 pay attention to?
- idea自动导包和自动删包设置
- Getting started with pytest -- description of fixture parameters
- 解决:代理抛出异常错误
猜你喜欢
Acelems Expressway microgrid energy efficiency management platform and intelligent lighting solution intelligent lighting tunnel
Alibaba cloud polkit pkexec local rights lifting vulnerability
unable to execute xxx. SH: operation not permitted
CY7C68013A之keil编译代码
Thinkphp內核工單系統源碼商業開源版 多用戶+多客服+短信+郵件通知
Lm09 Fisher inverse transform inversion mesh strategy
06 装饰(Decorator)模式
TypeScript函数详解
Promise all()
数学知识——快速幂的理解及例题
随机推荐
Mysql表insert中文变?号的问题解决办法
Win10 disk management compressed volume cannot be started
DMA Porter
How to modify data file path in DM database
ansible安装与使用
VMware installation win10 reports an error: operating system not found
Pytest learning ----- pytest assertion of interface automation testing
Learn BeanShell before you dare to say you know JMeter
Oracle stored procedure and job task setting
C# 基于MQTTNet的服务端与客户端通信案例
Leetcode- insert and sort the linked list
Embedded-c language-9-makefile/ structure / Consortium
Deeply understand the concepts of synchronization and asynchrony, blocking and non blocking, parallel and serial
LM09丨费雪逆变换反转网格策略
cs架构下抓包的几种方法
Cache consistency solution - how to ensure the consistency between the cache and the data in the database when changing data
Go Chan's underlying principles
AcrelEMS高速公路微电网能效管理平台与智能照明解决方案智慧点亮隧道
Ten thousand volumes are known to all, and one page of a book is always relevant. TVP reading club will take you through the reading puzzle!
MySQL table insert Chinese change? Solution to the problem of No