资源简介
网页截图 C# .NET 整页截图 本人参考网络资源独立开发 测试正常
代码片段和文件信息
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Windows.Forms;
namespace webpage_capture_screenshot
{
public class GetImage
{
private int S_Height;
private int S_Width;
private int F_Height;
private int F_Width;
private string wb;
public int ScreenHeight
{
get { return S_Height; }
set { S_Height = value; }
}
public int ScreenWidth
{
get { return S_Width; }
set { S_Width = value; }
}
public int ImageHeight
{
get { return F_Height; }
set { F_Height = value; }
}
public int ImageWidth
{
get { return F_Width; }
set { F_Width = value; }
}
public string WebSite
{
get { return wb; }
set { wb = value; }
}
public GetImage(string webSite int ScreenWidth int ScreenHeight int ImageWidth int ImageHeight)
{
this.wb = webSite;
this.ScreenWidth = ScreenWidth;
this.ScreenHeight = ScreenHeight;
this.ImageHeight = ImageHeight;
this.ImageWidth = ImageWidth;
}
public Bitmap GetBitmap()
{
WebPageBitmap Shot = new WebPageBitmap(this.WebSite this.ScreenWidth this.ScreenHeight);
Shot.GetIt();
Bitmap Pic = Shot.DrawBitmap(this.ImageHeight this.ImageWidth);
return Pic;
}
}
class WebPageBitmap
{
WebBrowser MyBrowser;
string URL;
int Height;
int Width;
public WebPageBitmap(string url int width int height)
{
this.Height = height;
this.Width = width;
this.URL = url;
MyBrowser = new WebBrowser();
MyBrowser.ScrollBarsEnabled = false;
MyBrowser.Size = new Size(this.Width this.Height);
}
public void GetIt()
{
MyBrowser.Navigate(this.URL);
CheckHTML ck = new CheckHTML();
int ret = -1;
//do
//{
if (-1 != ret) MyBrowser.Navigate(this.URL);
while (MyBrowser.ReadyState != WebBrowserReadyState.Complete)
{
Application.DoEvents();
}
ck.GetEncodeHtml(MyBrowser.DocumentStream);
ret = ck.AnalyzeDocType();
//} while (0 != ret);
this.Height = int.Parse(MyBrowser.Document.Body.GetAttribute(“scrollHeight“));
this.Width = int.Parse(MyBrowser.Document.Body.GetAttribute(“scrollwidth“));
//MyBrowser.Size = new Size(this.Width this.Height);
}
public Bitmap DrawBitmap(int theight int
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2011-12-10 22:38 webpage_capture_screenshot\bin\
目录 0 2011-12-10 11:44 webpage_capture_screenshot\bin\Release\
文件 32768 2011-12-10 19:58 webpage_capture_screenshot\bin\Release\webpage_capture_screenshot.exe
文件 52736 2011-12-10 19:58 webpage_capture_screenshot\bin\Release\webpage_capture_screenshot.pdb
文件 5632 2005-09-23 06:56 webpage_capture_screenshot\bin\Release\webpage_capture_screenshot.vshost.exe
文件 4143 2011-12-10 08:29 webpage_capture_screenshot\Class1.cs
文件 1542 2011-12-09 22:51 webpage_capture_screenshot\Class2.cs
文件 5352 2011-12-10 09:00 webpage_capture_screenshot\Class3.cs
文件 9268 2011-12-10 19:56 webpage_capture_screenshot\Class4.cs
文件 7935 2011-12-10 19:58 webpage_capture_screenshot\Form1.cs
文件 5625 2011-12-10 19:58 webpage_capture_screenshot\Form1.Designer.cs
文件 5814 2011-12-10 19:58 webpage_capture_screenshot\Form1.resx
目录 0 2011-12-10 11:44 webpage_capture_screenshot\obj\
目录 0 2011-12-10 11:43 webpage_capture_screenshot\obj\Debug\
目录 0 2011-12-08 00:39 webpage_capture_screenshot\obj\Debug\Refactor\
目录 0 2011-12-07 23:53 webpage_capture_screenshot\obj\Debug\TempPE\
文件 842 2011-12-10 11:43 webpage_capture_screenshot\obj\Debug\webpage_capture_screenshot.csproj.GenerateResource.Cache
文件 28672 2011-12-10 11:43 webpage_capture_screenshot\obj\Debug\webpage_capture_screenshot.exe
文件 180 2011-12-10 11:43 webpage_capture_screenshot\obj\Debug\webpage_capture_screenshot.Form1.resources
文件 42496 2011-12-10 11:43 webpage_capture_screenshot\obj\Debug\webpage_capture_screenshot.pdb
文件 180 2011-12-08 00:00 webpage_capture_screenshot\obj\Debug\webpage_capture_screenshot.Properties.Resources.resources
目录 0 2011-12-10 19:58 webpage_capture_screenshot\obj\Release\
文件 2021 2011-12-10 11:49 webpage_capture_screenshot\obj\Release\ResolveAssemblyReference.cache
目录 0 2011-12-10 11:44 webpage_capture_screenshot\obj\Release\TempPE\
文件 842 2011-12-10 19:58 webpage_capture_screenshot\obj\Release\webpage_capture_screenshot.csproj.GenerateResource.Cache
文件 32768 2011-12-10 19:58 webpage_capture_screenshot\obj\Release\webpage_capture_screenshot.exe
文件 180 2011-12-10 19:58 webpage_capture_screenshot\obj\Release\webpage_capture_screenshot.Form1.resources
文件 52736 2011-12-10 19:58 webpage_capture_screenshot\obj\Release\webpage_capture_screenshot.pdb
文件 180 2011-12-10 11:44 webpage_capture_screenshot\obj\Release\webpage_capture_screenshot.Properties.Resources.resources
文件 1570 2011-12-10 20:24 webpage_capture_screenshot\obj\webpage_capture_screenshot.csproj.FileListAbsolute.txt
文件 493 2011-12-07 23:53 webpage_capture_screenshot\Program.cs
............此处省略10个文件信息
相关资源
- 基于TCP的 modbus , C#源码
- 一套通用的Easyui+asp.net mvc开发框架源
- Visual Studio 2015(C#) Windows数据库项目
- visual C#从入门到精通第八版
- asp.net+sql博客管理系统
- ASP.NET编程宝典(C#)十年典藏版
- 20个C#项目实战开发及项目全部源码
- 利用C#与三菱Q系列以太网通信
- GeckoFX 火狐内核C#新浪微博Cookie读取
- .net 简单任务调度平台
- C# 绘制实时曲线包括绘制坐标轴
- C# 加减乘除 小练习winform)
- 《Unity5实战使用C#和Unity开发多平台游
- Unity5实战:使用C#和Unity开发多平台游
- c#应用webService实现自动升级源代码
- 缓冲区分析ae+c#
- C#英文词频统计-统计单词出现次数
- C#通过LPT并口打印POS小票芯烨XP系列
- 鲜花销售管理系统.zip
- C#VS2013与DirectX显示旋转的四棱锥
- musicQQ音乐协议登录源码
- C#视频帧提取
- TCL解释器C#源码
- C#和西门子PLC1200 以太网通讯
- C#绘制动态二维平面坐标系
- 获取鼠标所在窗口的句柄、类名c#
- 三层asp.net留言板源码.rar
- C#winform按钮风格封装
- ASP.NET仓储管理系统开题报告
- 配置好的固高运动控制卡C#项目并实现
评论
共有 条评论