Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I am trying to convert HTML to image using HtmlRenderer which contain 2 image in which one image is on the top of another I tried following code

Bitmap m_Bitmap = new Bitmap(700, 900);
PointF point = new PointF(0, 0);
SizeF maxSize = new System.Drawing.SizeF(800, 1000);
string html = "<html><head></head><body> Test<img style=\"position: absolute; left: 199px; top: 293px;\" src=\"file:///C:/Users/crakhuc/Desktop/Small.jpg\">
</body></html>";
HtmlRenderer.HtmlRender.Render(Graphics.FromImage(m_Bitmap),html,point, maxSize);

m_Bitmap.Save(@"C:\Test.png", ImageFormat.Png);


Problem with this is that second image dont come on top of first it comes at bottom of first image
Posted
Updated 8-Oct-14 20:48pm
v2
Comments
Zoltán Zörgő 9-Oct-14 3:33am    
You mean this one: https://htmlrenderer.codeplex.com/ ?

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900