static void Main(string[] args) { WebPageBitmap webBitmap = new WebPageBitmap("http://google.com.pe", 800, 600, false, 10000); if (webBitmap.IsOk) { webBitmap.Fetch(); Bitmap thumbnail = webBitmap.GetBitmap(800, 600); thumbnail.Save("captura.jpg", ImageFormat.Jpeg); thumbnail.Dispose(); } }
// // FetchWebPageData // // Gets the web page image for the selected url, // then stores the page in the web page cache // static private void FetchWebPageData(string url, Guid compiledWebPageGuid) { try { string filename = ImageUtil.GetCompiledImageDirectory("WebPageFetchCache") + compiledWebPageGuid + ".jpg"; Bitmap webPageBitmap = WebPageBitmap.Fetch(new Uri(url).AbsoluteUri, 800, 600); webPageBitmap.Save(filename, ImageFormat.Jpeg); } catch (Exception) { } }