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), "
This is a sh***y html code
This is another html line
", 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.
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.


VulpesRank #55 · 29.2K reputationPosted May 12, 2013, 8:05 AM EDT
This will probably not be permitted unless you're running with administrative privileges.
So I'd try saving to a different directory.
Amogh NatuRank #1,956 · 748 reputationPosted May 12, 2013, 9:56 PM EDT