相关疑难解决方法(0)

以编程方式截取网页截图

如果输入URL,如何以编程方式拍摄网页的情景?

这就是我现在所拥有的:

// The size of the browser window when we want to take the screenshot (and the size of the resulting bitmap)
Bitmap bitmap = new Bitmap(1024, 768);
Rectangle bitmapRect = new Rectangle(0, 0, 1024, 768);
// This is a method of the WebBrowser control, and the most important part
webBrowser1.DrawToBitmap(bitmap, bitmapRect);

// Generate a thumbnail of the screenshot (optional)
System.Drawing.Image origImage = bitmap;
System.Drawing.Image origThumbnail = new Bitmap(120, 90, origImage.PixelFormat);

Graphics oGraphic = Graphics.FromImage(origThumbnail);
oGraphic.CompositingQuality = CompositingQuality.HighQuality;
oGraphic.SmoothingMode …
Run Code Online (Sandbox Code Playgroud)

.net c# screenshot webpage-screenshot

15
推荐指数
1
解决办法
3万
查看次数

标签 统计

.net ×1

c# ×1

screenshot ×1

webpage-screenshot ×1