TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Chris
NA
1
0
Out of Memory Exception when resizing Bitmap
Apr 1 2009 4:08 PM
So, the function works great for smaller image, but as I try to increase the size of the resized Image, eventually I will run into an Out of Memory Exception.
The function I currently have is:
public static Bitmap ResizeImage(Bitmap srcImage, int width, int height)
{
Bitmap result = new Bitmap(width, height);
using (Graphics g = Graphics.FromImage((Image)result))
g.DrawImage(srcImage, new Rectangle(0, 0, width, height), new Rectangle(0, 0, srcImage.Width, srcImage.Height), GraphicsUnit.Pixel);
return result;
}
Any thoughts to improve/change the method to not get the OOM Exception?
Reply
Answers (
2
)
How to overwrite DLL files??
How to create one bitmap from two?