网页htmt转为图片(net2.0)
来源:互联网 发布:明朝那些事儿 知乎 编辑:程序博客网 时间:2024/05/19 17:48
第一步 using System.Runtime.InteropServices;
第二步 public const int SRCCOPY = 0x00CC0020; // BitBlt dwRop parameter
[DllImport("gdi32.dll")]
public static extern bool BitBlt(IntPtr hObject, int nXDest, int nYDest,
int nWidth, int nHeight, IntPtr hObjectSource,
int nXSrc, int nYSrc, int dwRop);
[DllImport("gdi32.dll")]
public static extern IntPtr CreateCompatibleBitmap(IntPtr hDC, int nWidth,
int nHeight);
[DllImport("gdi32.dll")]
public static extern IntPtr CreateCompatibleDC(IntPtr hDC);
[DllImport("gdi32.dll")]
public static extern bool DeleteDC(IntPtr hDC);
[DllImport("gdi32.dll")]
public static extern bool DeleteObject(IntPtr hObject);
[DllImport("gdi32.dll")]
public static extern IntPtr SelectObject(IntPtr hDC, IntPtr hObject);
第三步 using (Graphics srcGraphics = this.webBrowser1.CreateGraphics())
{
using (Graphics destGraphics = this.pictureBox1.CreateGraphics())
{
IntPtr hdcDest = destGraphics.GetHdc();
IntPtr hdcSrc = srcGraphics.GetHdc();
BitBlt(
hdcDest,
0, 0,
this.webBrowser1.ClientRectangle.Width, this.webBrowser1.ClientRectangle.Height,
hdcSrc,
0, 0,
(int)SRCCOPY
);
srcGraphics.ReleaseHdc(hdcSrc);
destGraphics.ReleaseHdc(hdcDest);
}
}
- 网页htmt转为图片(net2.0)
- 网页中的动画效果转为GIF图片
- ASP.NET2.0图片处理
- QtWebkit中如何将网页内容转为图片
- .NET2.0抓取网页全部链接
- .NET2.0抓取网页全部链接
- Asp.NET2.0抓取网页全部链接
- .NET2.0抓取网页全部链接
- .NET2.0抓取网页全部链接
- .NET2.0抓取网页全部链接
- .NET2.0抓取网页全部链接
- NET2.0抓取网页全部链接
- .NET2.0抓取网页全部链接
- .NET2.0抓取网页全部链接
- 网页通用视频播放(asp.net2.0)
- ASP.NET2.0中构造个性化网页
- ASP.Net2.0WebPart趣味网页设计
- ASP.NET2.0中构造个性化网页
- 实现标题条的显示与隐藏
- 格式: echo "/033[字背景颜色;字体颜色m字符串/033[0m"
- 中文信息转Unicode编码
- 给c++程序员的一份礼物——常用工具集(转)
- 指针与几何
- 网页htmt转为图片(net2.0)
- 从头开始学习java
- C++捷径之六
- PHP比ASP优秀的七个理由
- 使用动态ActionForm-DynaActionForm(原理)
- Windows 下mysql批处理问题
- C++反汇编揭秘1 一个简单的C++程序反汇编解析
- [翻译]xml的加密和解密
- TimeSpan 和DateTime