开发者

Taking screen shot of a (remote) web page programmatically

I'm trying to take screen shots of web pages programmatically. I may also require to take screen shots of full or partial page. Is there a way to do this开发者_运维百科?


This question seems to cover capturing web pages - including alternatives to WebBrowser.DrawToBitmap. I guess once you've got the full page as an image you can manipulate that to get the partial page shot


Check out webbrowser method

webBrowser1.DrawToBitmap(bitmap, bitmapRect);

for more complete example go here


you could use a WebBrowser control, and use the VB PrintForm control to capture the output.


Try this

Rectangle region = new Rectangle(0, 0, SystemInformation.VirtualScreen.Width, SystemInformation.VirtualScreen.Height);
using (Bitmap bitmap = new Bitmap(region.Width, region.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb))
using (Graphics bitmapGraphics = Graphics.FromImage(bitmap))
{
bitmapGraphics.CopyFromScreen(region.Left, region.Top, 0, 0, region.Size);
bitmap.Save("location");
}

Source : http://www.dotnetthoughts.net/2007/04/13/capture-screen-using-c-and-net-20/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜