惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
罗磊的独立博客
T
The Blog of Author Tim Ferriss
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
Last Week in AI
Last Week in AI
美团技术团队
Google Online Security Blog
Google Online Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
D
Docker
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
月光博客
月光博客
L
LINUX DO - 最新话题
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
W
WeLiveSecurity
H
Heimdal Security Blog
Vercel News
Vercel News
SecWiki News
SecWiki News
Forbes - Security
Forbes - Security
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
TaoSecurity Blog
TaoSecurity Blog
T
Troy Hunt's Blog
A
About on SuperTechFans
C
Check Point Blog
S
Security Affairs
Hacker News - Newest:
Hacker News - Newest: "LLM"
AI
AI
WordPress大学
WordPress大学
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Help Net Security
Help Net Security
博客园_首页
The Last Watchdog
The Last Watchdog
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Engineering at Meta
Engineering at Meta
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
I
Intezer
K
Kaspersky official blog
M
MIT News - Artificial intelligence
J
Java Code Geeks
G
GRAHAM CLULEY
P
Palo Alto Networks Blog

博客园 - 千年寒冰

C# 操作Excel大全 Window7+vs2008+QT环境搭建 基于三汇语音卡的呼叫中心开发--(一) 解决NTLDR is missing,系统无法启动的方法 mssql charindex 美化表单 屏幕取字原理 jsp web项目开发详述 jsp request 对象详解 博文阅读密码验证 - 博客园 WML教程9:Select List 控件 jsp的session介绍 (转) 想一想 javabean :类与函数调用(数据库访问类) JSP中的pageEncoding和contentType属性(转) javabean在jsp中的调用(原创) 远程连接SQL Server (转) 三天学好ADO(转) jsp调用javabean实例
Wince 或Windows平台 C#调用Bitmap对象后资源应该如何释放
千年寒冰 · 2013-04-08 · via 博客园 - 千年寒冰

做Wince项目时遇到的问题,

 将相机拍摄的图像从SD卡读入BitMap,然后在克隆给PictureBox;即:Bitmap bmp=new Bitmap(FilePath); Picture.Image=(Image)bmp.Clone();bmp.Dispose();查看前2张图片没有问题,第3张图片时就报内存溢出了.

尝试了多种释放资源的方式,包括GC强制回收都没有效果,后来看到别人C++代码里面对BitMap位图操作时,采用DeleteObject进行释放的。我也在C#里进行了尝试,还真释放干净了;记录这里备忘;

    [DllImport("coredll.dll")]

    [return: MarshalAs(UnmanagedType.Bool)]

    public static extern bool DeleteObject(IntPtr hgdiobj);