Provide state-of-the-art image capture, screen capture, video capture and audio capture software
Home     Download     Purchase     Support     Contact     View my shopping cart
You are here: ACASystems » ACA WebThumb ActiveX Control » FAQ » Generate image from HTML with C#

How to generate image from HTML with C#? - C# Sample Code(3)

If you have some C# applications that would benefit from having images and thumbnails (sometimes called thumbshots) of internet HTML web pages, you can try ACA WebThumb ActiveX. With a few function calls in Visual C#(C-sharp), it generates image from HTML web page and saves as JPG, GIF, PNG, BMP, TIFF, WMF and EMF image. If you want to write a C# application including web thumbnails feature, this developer SDK may be very useful for you.

Guidelines: Generate image from HTML with C#

  1. Free download the HTML Converter SDK - ACA WebThumb ActiveX, and then install it.
  2. You will find a C# demo project in the folder {install-folder}\sample\c#.
  3. You can open this C# demo project with VS2003 or VS2005, build and run it.

Free Trial ACA WebThumb ActiveX Now

Example code: C# - Generate image from HTML

An example for C#:

// C# - Generate image from HTML web page
// Set the image filename.
string t_strSaveFolder = Server.MapPath("./");           
string t_strLargeImage = t_strSaveFolder + "\\" + "acasystems.large.png";
string t_strSmallImage = t_strSaveFolder + "\\" + "acasystems.small.png";

// Create instance
ThumbMakerClass t_xThumbMaker = new ACAWebThumbLib.ThumbMakerClass();

// Start generate image from web page http://www.acasystems.com 
t_xThumbMaker.SetURL("http://www.acasystems.com");
t_xThumbMaker.StartSnap();

// Get the image width and height
long t_lWidth = t_xThumbMaker.GetThumbWidth();
long t_lHeight = t_xThumbMaker.GetThumbHeight();

// Save the image with full size in C#
t_xThumbMaker.SaveImage(t_strLargeImage);

// Save the image with 320x240 in C#
t_xThumbMaker.SetThumbSize(320, 240, 0);
t_xThumbMaker.SaveImage(t_strSmallImage);

Example Snapshots that Generate from HTML web page by ACA WebThumb ActiveX

www.acasystems.com

www.download.com

www.msn.com

en.wikipedia.org

Free Trial ACA WebThumb ActiveX Now

Other resource about Converting HTML to image in C#:

  • ASP Sample Code: How to convert HTML to image with ASP?
  • C# Sample Code (1): How to convert HTML to image in C# (C-sharp)?
  • C# Sample Code (2): How to capture web page to image with C# (C-sharp)?
  • C# Sample Code (4): How to take screenshot of web page in C# (C-sharp)?
  • C# Sample Code (5): How to take snapshot from HTML in C# (C-sharp)?
  • Java Sample Code: How to convert HTML to image in Java?
  • PHP Sample Code(1): How to convert HTML to image with PHP?
  • PHP Sample Code(2): How to convert webpage to image with PHP?
  • .Net Sample Code: How to convert HTML to image in ASP.Net??
  • FAQ: Which image format is best?
  • FAQ: What programming languages does ACA WebThumb ActiveX Control support?
  • ACA WebThumb ActiveX Interface Reference
  • Free Download ACA WebThumb ActiveX Control
  • Wikipedia.org: C Sharp(C#)
  • Microsoft MSDN: Visual C# Developer Center

  • Get discount alerts, new product information and technical articles:
    Name:
    Email:
    * Get 10% off your first order by joining our mailing list!
    * You may safely unsubscribe at any time!