当前注册人数423000人 邮箱: 密码: 注册新用户 忘记密码
首页 C/C++/MFC C# ASP.NET VB.NET MATLAB Android   站内搜索 下载代码说明/积分规则
为什么要注册?

1. 可以直接免费从本站下载代码,防止邮件发送不到您的邮箱,或登录不了国外网站

2. 可以设定关键字,当有您关心的代码收录时,邮件通知您

3. 对这里的代码进行评分和评论

4. 可以和大家一起分享你的源代码,得到更多的建议

Capture Entire Web Page

Web网页内容捕获/抓取(存储成图像)源代码

2008年02月24日
VB, VB 8.0, Windows, .NET, VS, VS2005, Dev
本程序操作IE7.0,实现整个网页的抓取功能。它可以捕获整个Web页面,然后保存成一个图像文件。由于,它是通过操作IE浏览器完成的,所以,网页的cookies之类的信息都自动登录,你会在截取之后的图像中见到和浏览器里面一模一样的内容。可以存储的图像格式支持PNG,JPEG,GIF,TIFF,BMP,EMF,WMF等等,多种格式。
相关知识

 

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
源代码原文下载:
Capture Entire Web Page Capture an entire web page and save it as an image.

源码图片

点击链接查看大图
从本站下载附件及源代码(1个附件,已经成功下载441次)

最值得关注的外文源代码

SuperMail.NET, a bulk emailing app using System.Net.Mail, MS Access, and My.Settings
GPS Tracer Extension: Storing the Path on SQL2005 via Web Services
jMVC.NET: Easy dynamic client-side UIs with clean MVC coding
Building Multi-Tier Web Application in .NET 3.5 Framework Using LINQ to SQL
评论(评论是增加积分的一个有效途径)
字数在300字内
请如实评论
本源代码共评论63次,此处显示最近20次评论! 查看所有评论

arisn  2014年12月28日
谢谢分享
gongpan10  2014年10月10日
我也要学学
longxinchuan  2014年07月16日
谢谢分享
adamj0641  2013年11月03日
学习
林振望  2013年01月20日
ding
tanta  2012年07月25日
学习
saaf  2012年01月25日
好啊.
chenjijie  2011年12月31日
谢谢分享
陈禧  2011年12月27日
谢谢分享
surfingpan  2011年12月19日
谢谢
surfingpan  2011年12月12日
顶起
cao  2011年11月23日
很好
gm  2011年10月11日
不错,大家下载看看
静水流深  2010年12月22日
谢谢
WILL  2010年12月22日
谢谢
青草  2010年03月17日
Web网页内容捕获
coco168  2009年12月22日
Capture Entire Web Pag
wayn  2009年08月07日
着急想用呢
harder  2009年07月12日
来学习下
woojune  2009年06月28日
看看,学习一下vb
字数在300字内
请如实评论
200万国内源码搜索
CopyRight (C) codesoso.com 2007-2009 All Rights Reserved zhihuishi   免责声明