Download ACA WebThumb ActiveX |
For Windows 7/Vista/2003/XP/2000
Sometimes, we want to take screenshot of web page in C# and then save as image file or output to the client's browser. To add this feature in your C# project, you can try ACA WebThumb ActiveX - a web page to image developer SDK. It helps your capture the full length web page screenshots of given URLs in batch, general thumbnial image preview of given URLs with a few function calls. In this tutorial we will see how we can take screenshot of web page in C# script codes.
This C-sharp sample script shows how to take screenshot from http://en.wikipedia.org/wiki/Screenshot and then saves as .JPG format.
// C# - Take screenshot of web page // Specify the image filename. // [IMPORTANT NOTE]: // This sample saves the screenshot image to the folder on the work dir of this script. // Please make sure the script has the WRITE permission in this folder. // You can also set the value to other folder by yourself, for example: // string t_strImageFolder = "c:/tmp"; string t_strImageFolder = Server.MapPath("./"); string t_strFullImageFile = t_strImageFolder + "\\" + "wiki-fullsize.jpg"; string t_strSmallImageFile = t_strImageFolder + "\\" + "wiki-thumbnail.jpg"; // Create ActiveX object ThumbMakerClass t_xWebSnapor = new ACAWebThumbLib.ThumbMakerClass(); // Start capture web page from http://en.wikipedia.org/wiki/Screenshot t_xWebSnapor.SetURL("http://en.wikipedia.org/wiki/Screenshot"); t_xWebSnapor.StartSnap(); // Save the screenshot of web page in c#, image size: full size t_xWebSnapor.SaveImage(t_strFullImageFile); // Save the screenshot of web page in c#, image size: 320x240 t_xWebSnapor.SetThumbSize(320, 240, 0); t_xWebSnapor.SaveImage(t_strSmallImageFile); // Show the image pictureBox_small.Image = Image.FromFile(t_strSmallImageFile); pictureBox_full.Image = Image.FromFile(t_strFullImageFile);
Download ACA WebThumb ActiveX |
For Windows 7/Vista/2003/XP/2000