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

推荐订阅源

T
Threatpost
S
Securelist
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
Threat Research - Cisco Blogs
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tenable Blog
I
Intezer
G
GRAHAM CLULEY
Spread Privacy
Spread Privacy
T
Tor Project blog
V
Vulnerabilities – Threatpost
NISL@THU
NISL@THU
L
Lohrmann on Cybersecurity
Schneier on Security
Schneier on Security
MyScale Blog
MyScale Blog
The GitHub Blog
The GitHub Blog
S
Security @ Cisco Blogs
The Register - Security
The Register - Security
酷 壳 – CoolShell
酷 壳 – CoolShell
B
Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
L
LangChain Blog
人人都是产品经理
人人都是产品经理
T
Tailwind CSS Blog
MongoDB | Blog
MongoDB | Blog
小众软件
小众软件
The Hacker News
The Hacker News
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
U
Unit 42
博客园 - 叶小钗
Attack and Defense Labs
Attack and Defense Labs
Webroot Blog
Webroot Blog
大猫的无限游戏
大猫的无限游戏
Apple Machine Learning Research
Apple Machine Learning Research
H
Hackread – Cybersecurity News, Data Breaches, AI and More
aimingoo的专栏
aimingoo的专栏
T
Troy Hunt's Blog
V
Visual Studio Blog
P
Proofpoint News Feed
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
A
Arctic Wolf
T
The Exploit Database - CXSecurity.com
宝玉的分享
宝玉的分享
Vercel News
Vercel News
D
DataBreaches.Net
P
Palo Alto Networks Blog
AI
AI
Simon Willison's Weblog
Simon Willison's Weblog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC

博客园 - 所言非虚

未来谁才是移动互联网的入口? [Oracle]Sqlplus连接成功,但pl/sql连接不成功,提示“ora-12145:无法解析指定的连接标识符” Windows待机、休眠、睡眠的区别以及程序运行策略 [Worldwind]worldwind源码编译 windows server 2008 x64下oracle 10gR2的安装方法 [长期]常见问题收集 最佳编程字体推荐 GDAL问题收集 向量点积与叉积的定义及应用 空间平面法向量求法 【原创】随鼠标移动显示地图经纬度 - 所言非虚 - 博客园 【原创】客户端添加兴趣点,并随地图变化而变化 - 所言非虚 - 博客园 【原创】利用ESRI自带的符号库进行符号化 FireFox与IE的兼容 【转】兼容IE和FireFox的鼠标滚轮事件 DIV的精确定位 - 所言非虚 - 博客园 ArcGIS Server开发的一些小经验 ArcSDE C API在.NET中的调用 - 所言非虚 [译]ArcGIS Server Map Service Cache的组织结构
【解决】加载图片"内存不足"问题
所言非虚 · 2008-10-22 · via 博客园 - 所言非虚

       在加载图片,如Bitmap image=new Bitmap(filename)或使用DrawImage之类的方法绘制图形时时,可能会出现“内存不足”的问题! 使用Dispose方法来清除对象占用的内存,但也还是没用! 以下是可能的解决办法: 使用Dispose方法清除对象是,如果此对象还受到其他对象的引用,则不能成功清除。因此,清除对象占用的内存的办法就是把所有引用的对象也同时Dispose掉,而谁引用了此对象在实际中是可以判断的。

1 Bitmap image=new Bitmap(filename);
2 Bitmap new_image=new Bitmap(256,256);
3 Graphics new_gra=Graphics.FromImage(new_image);
4 new_gra.DrawImage(image,0,0,256,256);
5 //此时应当卸载的对象
6 new_gra.dispose();
7 new_image.dispose();
8 image.dispose();