Quantcast
Channel: HTML Renderer
Viewing all articles
Browse latest Browse all 693

New Post: Image loading issue

$
0
0
I run this code with the latest (1.4.10.0) and it works fine... can you verify the problem, do you need to create image with transparent background?
string path = " D://OriginalImage.png";
string newPath = "D://NewImage.png";
Size maxSize = new Size(674, 690);
string html = "<html><body><div style=\"background-image:url(" + path + ");height:674px;width:670px;text-align:center;\"><div style=\"height:674px;width:670px;margin-top:400px;\"><span>Test</span></div></body></html>";
var img = HtmlRenderer.HtmlRender.RenderToImage(html, maxSize);
img.Save(newPath, ImageFormat.Png);
Result:
Image

Viewing all articles
Browse latest Browse all 693

Trending Articles