Tech
Forums
Jobs
Books
Events
Live
Interviews Prep
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
A generic error occured in GDI+. Why is this exception being
Amogh Natu
May 12 2013 11:11 AM
3.4k
Reply
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.
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
How to use CGI with Apache Server
draw sprite