文件名称:VB.net捕获整个网页并保存成图像
文件大小:816KB
文件格式:RAR
更新时间:2011-11-03 07:24:08
VB.net 网页 保存成图像
VB.net捕获整个网页并保存成图像有软件 Private Sub GetImage() If WebBrowser1.Document Is Nothing Then Return End If Try Dim scrollWidth As Integer Dim scrollHeight As Integer scrollHeight = WebBrowser1.Document.Body.ScrollRectangle.Height scrollWidth = WebBrowser1.Document.Body.ScrollRectangle.Width WebBrowser1.Size = New Size(scrollWidth, scrollHeight) Dim bm As New Bitmap(scrollWidth, scrollHeight) WebBrowser1.DrawToBitmap(bm, New Rectangle(0, 0, bm.Width, bm.Height)) Dim SaveAsName As String SaveAsName = Regex.Replace(textWebURL.Text, "(\\|\/|\:|\*|\?|\""|\<|\>|\|)?", "") bm.Save(SaveAsName & ".png", System.Drawing.Imaging.ImageFormat.Png) bm.Dispose() Catch ex As Exception MessageBox.Show(ex.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error) Finally ' End Try buttonCapture.Enabled = True End Sub
【文件预览】:
WebCapture1b.zip
WebCapture.zip
CodeProject Capture Entire Web Page_ Free source code and programming help 2.png
CodeProject Capture Entire Web Page_ Free source code and programming help.htm
CodeProject Capture Entire Web Page_ Free source code and programming help 1.gif