嗨,我想使用HTMLRenderer将HTML转换为图像。我能够将HTML转换为图像,但是字体显得粗体和模糊。转换时分辨率似乎破了。
Bitmap m_Bitmap = new Bitmap(850,700);
PointF point = new PointF(0, 0);
SizeF maxSize = new System.Drawing.SizeF(850, 700);
string stylesshet = "";
HtmlRenderer.HtmlRender.Render(
Graphics.FromImage(m_Bitmap),
"<table><tr><td> 123 </td><td>456</td></tr><tr><td> 123 </td><td>456</td></tr></table>",
point,
maxSize);
m_Bitmap.Save(ImagePath, ImageFormat.Png);