HtmlScreenCapture – Live Writer SDK 中好用的 class
三月 8, 2009
HtmlScreenCapture 可以將 HTML 內容(或指定網址)快照成圖檔。(Provides the ability to capture HTML content into a bitmap. [#]) 要參考 C:\Program Files\Windows Live\Writer\WindowsLive.Writer.Api.dll 程式碼: using System; using System.Collections.Generic; using System.Text; using WindowsLive.Writer.Api; class Program { static void Main(string[] args) { // 從指定網址截圖 WindowsLive.Writer.Api.HtmlScreenCapture capture = new HtmlScreenCapture(new Uri("http://tw.yahoo.com"), 1024/*寬度*/); System.Drawing.Bitmap bmp = capture.CaptureHtml(5000/*timeoutMs*/); bmp.Save(@"C:\1.png", System.Drawing.Imaging.ImageFormat.Png); // 從 html 內容截圖 WindowsLive.Writer.Api.HtmlScreenCapture [...]
迴響已關閉