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
Amogh Natu
NA
700
323.5k
A generic error occured in GDI+. Why is this exception being
May 12 2013 11:11 AM
I'm trying to convert HTML Text to a .bmp image. I'm using the following code for performing the operation.
Bitmap m_Bitmap = new Bitmap(400, 600);
PointF point = new PointF(0, 0);
SizeF maxSize = new System.Drawing.SizeF(500, 500);
HtmlRenderer.HtmlRender.Render(Graphics.FromImage(m_Bitmap), "<html><head></head><body><p>This is a sh***y html code</p><p>This is another html line</p></body>", point, maxSize);
m_Bitmap.Save(@"C:\Test.bmp");
"HtmlRenderer" is an external namespace that is being used here. However, I'm getting an exception at the "m_Bitmap.Save(@"C:\Test.bmp");" line that says :
A generic error occured in GDI+.
I'm unable to understand why this exception is being raised when the same code is running perfectly in my colleague's system.
Please help. Thanks a lot.
Reply
Answers (
2
)
How to use CGI with Apache Server
draw sprite