If you are an ASP.Net developer, you may want to convert HTML to image in your .Net desktop program or web application. To add HTML to JPEG, HTML to PNG feature to your .Net application, you can try our developer SDK - ACA WebThumb ActiveX. With a few function calls in your .Net application, it converts the HTML web pages of given URLs to the image files (JPG, GIF, PNG, BMP, TIFF, WMF and EMF). You can also get the HBITMAP handle or image bytes in memory.
Free Trial ACA WebThumb ActiveX Now
// C# sample code: convert HTML to image // Set the image filename. string t_Image_Save_Folder = Server.MapPath("./"); string t_Full_Image_File = t_Image_Save_Folder + "\\" + "thumbnail.full.png"; string t_Small_Image_File = t_Image_Save_Folder + "\\" + "thumbnail.small.png"; // Create instance ThumbMakerClass HTML2IMAGE = new ACAWebThumbLib.ThumbMakerClass(); // Start convert web page http://www.acasystems.com to image HTML2IMAGE.SetURL("http://www.acasystems.com"); HTML2IMAGE.StartSnap(); // Save the image with full size in C# HTML2IMAGE.SaveImage(t_Full_Image_File); // Save the image with 320x240 in C# HTML2IMAGE.SetThumbSize(320, 240, 0); HTML2IMAGE.SaveImage(t_Small_Image_File);
' VB.net sample code: convert HTML to image, save as JPEG format ' Set the image files Dim t_strSaveFolder = Application.StartupPath Dim t_strLargeImage = t_strSaveFolder & "\\web-thumbnail.large.jpeg" Dim t_strSmallImage = t_strSaveFolder & "\\web-thumbnail.small.jpeg" ' Start the snap task Dim HTML2JPG As New ACAWebThumbLib.ThumbMaker HTML2JPG.SetURL("http://www.acasystems.com") HTML2JPG.StartSnap() ' Save the HTML to image with full size HTML2JPG.SaveImage(t_strLargeImage) ' Save the HTML to image with 240x180 HTML2JPG.SetThumbSize(240, 180, 0) HTML2JPG.SaveImage(t_strSmallImage) ' Show the image in the picture box control pictureBox1.Image = Image.FromFile(t_strSmallImage) pictureBox2.Image = Image.FromFile(t_strLargeImage)
Free Trial ACA WebThumb ActiveX Now