不知道哪位大哥知道如何把刚抓取的页面生成为一张图片! 没有头绪,请大家帮帮忙 不知道哪位大哥知道如何把刚抓取的页面生成为一张图片! 没有头绪,请大家帮帮忙抓取页面容易,可生成为一张图片不知道怎么办啊~~~ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你在附件里粘贴就是了。。保存为Jpeg格式的图片 截成为图片,然后保存为JPG格式! 方法一、屏幕硬copy方法二、使用QQ或者supercapture来做 System.Windows.Forms 命名空间中的Clipboard类 DATAFORMATS.BITMAP呵呵,一下想出来,也不一定能行 ?这个是个什么问题啊???是问怎么截图,,还是问怎么用asp.net做截图? using System ;using System.Drawing ;using System.Collections ;using System.ComponentModel ;using System.Windows.Forms ;using System.Data;public class Form1 : Form{private RichTextBox richTextBox1 ;private Button button1 ;private System.ComponentModel.Container components = null ;public Form1(){//初始化窗体中的各个组件InitializeComponent ( ) ;}//清除程序中使用过的资源protected override void Dispose ( bool disposing ){if ( disposing ){if ( components != null ) {components.Dispose ( ) ;}}base.Dispose ( disposing );}private void InitializeComponent ( ){this.richTextBox1 = new RichTextBox ( ) ;this.button1 = new Button ( ) ;this.SuspendLayout ( ) ;this.richTextBox1.Location = new System.Drawing.Point ( 40 , 16 ) ;this.richTextBox1.Name = "richTextBox1" ;this.richTextBox1.Size = new System.Drawing.Size ( 336 , 264 ) ;this.richTextBox1.TabIndex = 0 ;this.richTextBox1.Text = "" ;this.button1.Location = new System.Drawing.Point ( 128 , 304 ) ;this.button1.Name = "button1" ;this.button1.Size = new System.Drawing.Size ( 128 , 24 ) ;this.button1.TabIndex = 1 ;this.button1.Text = "获得剪切板中的数据" ;this.button1.Click += new System.EventHandler ( this.button1_Click ) ;this.AutoScaleBaseSize = new System.Drawing.Size ( 6 , 14 ) ;this.ClientSize = new System.Drawing.Size ( 408 , 357 ) ;this.Controls.Add ( button1 );this.Controls.Add ( richTextBox1 );this.Name = "Form1";this.Text = "用Visual C#来保存剪切板中的数据!";this.ResumeLayout(false);}static void Main ( ) {Application.Run ( new Form1 ( ) ) ;}private void button1_Click ( object sender , System.EventArgs e ){ //定义一个IDataObject接口IDataObject d = Clipboard.GetDataObject ( ) ;//如果剪切板中数据是位图,则另存为C盘的my.bmp文件if ( d.GetDataPresent ( DataFormats.Bitmap ) ) {//出箱Bitmap b = ( Bitmap ) d.GetData ( DataFormats.Bitmap ) ;b.Save ( @"c:\my.bmp" ) ;MessageBox.Show ( "当前剪切板内容是位图,已经保存到"MY.BMP"文件中!" ) ;} //如果是文本,则用窗体中的RichText组件显示文本内容。else if ( d.GetDataPresent ( DataFormats.Text ) ) {//出箱String c = ( String ) d.GetData ( DataFormats.Text ) ; richTextBox1.Text = c ;} else {MessageBox.Show ( "剪切板中是其他类型的数据!" ) ;}}} 我的意思是,怎么才能把下面这段html的显示内容生成为一装图片呢:<html><head></head><body bgcolor="#BFD7EA" text="#000000"><TABLE cellSpacing=0 cellPadding=0 width=521 align=center border=0> <TBODY> <TR> <TD height=8><img src="../images/newstop.gif" width="577" height="54"></TD> </TR> </TBODY> </TABLE></body></html>生成一张背景为#BFD7EA 背景图片为newstop.gif的图片 to :littlehb(在JAVA与。NET之间彷徨)有一疑问:如何将网页放入clipboard中呢?你写的代码只是将clipboard中的内容存入到一个bmp中,但怎么将网页读入clipboard呢?------------------------------我是来学习的!!!! UpdatePanel绑定GridView中的子控件问题 关于masterpage中的元素值的获取 在用户控件如何取到页面的值,我的用户控件是动态加载上去的... 如何遍历页面上从a1-a30的控件? 从数据库验证用户名是否存在! 未将对象引用设置到对象的实例。 连接数据库问题!我是菜鸟! 存储过程!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 如何显示dropdownlist的全部内容? 老系统升级的几个疑问(关于浏览器版本与css3) 各位大侠:那里有vs.net2003的高速下载?????必有重谢!!!!!! 怎么取得excle里的表和列名称
方法二、使用QQ或者supercapture来做
呵呵,一下想出来,也不一定能行
using System.Drawing ;
using System.Collections ;
using System.ComponentModel ;
using System.Windows.Forms ;
using System.Data;
public class Form1 : Form
{
private RichTextBox richTextBox1 ;
private Button button1 ;
private System.ComponentModel.Container components = null ;
public Form1()
{
//初始化窗体中的各个组件
InitializeComponent ( ) ;
}
//清除程序中使用过的资源
protected override void Dispose ( bool disposing )
{
if ( disposing )
{
if ( components != null )
{
components.Dispose ( ) ;
}
}
base.Dispose ( disposing );
}
private void InitializeComponent ( )
{
this.richTextBox1 = new RichTextBox ( ) ;
this.button1 = new Button ( ) ;
this.SuspendLayout ( ) ;this.richTextBox1.Location = new System.Drawing.Point ( 40 , 16 ) ;
this.richTextBox1.Name = "richTextBox1" ;
this.richTextBox1.Size = new System.Drawing.Size ( 336 , 264 ) ;
this.richTextBox1.TabIndex = 0 ;
this.richTextBox1.Text = "" ;this.button1.Location = new System.Drawing.Point ( 128 , 304 ) ;
this.button1.Name = "button1" ;
this.button1.Size = new System.Drawing.Size ( 128 , 24 ) ;
this.button1.TabIndex = 1 ;
this.button1.Text = "获得剪切板中的数据" ;
this.button1.Click += new System.EventHandler ( this.button1_Click ) ;this.AutoScaleBaseSize = new System.Drawing.Size ( 6 , 14 ) ;
this.ClientSize = new System.Drawing.Size ( 408 , 357 ) ;
this.Controls.Add ( button1 );
this.Controls.Add ( richTextBox1 );
this.Name = "Form1";
this.Text = "用Visual C#来保存剪切板中的数据!";
this.ResumeLayout(false);}
static void Main ( )
{
Application.Run ( new Form1 ( ) ) ;
}
private void button1_Click ( object sender , System.EventArgs e )
{ //定义一个IDataObject接口
IDataObject d = Clipboard.GetDataObject ( ) ;
//如果剪切板中数据是位图,则另存为C盘的my.bmp文件
if ( d.GetDataPresent ( DataFormats.Bitmap ) )
{
//出箱
Bitmap b = ( Bitmap ) d.GetData ( DataFormats.Bitmap ) ;
b.Save ( @"c:\my.bmp" ) ;
MessageBox.Show ( "当前剪切板内容是位图,已经保存到"MY.BMP"文件中!" ) ;
} //如果是文本,则用窗体中的RichText组件显示文本内容。
else if ( d.GetDataPresent ( DataFormats.Text ) )
{
//出箱
String c = ( String ) d.GetData ( DataFormats.Text ) ;
richTextBox1.Text = c ;
}
else
{
MessageBox.Show ( "剪切板中是其他类型的数据!" ) ;
}
}
}
<html>
<head>
</head>
<body bgcolor="#BFD7EA" text="#000000">
<TABLE cellSpacing=0 cellPadding=0 width=521 align=center border=0>
<TBODY>
<TR>
<TD height=8><img src="../images/newstop.gif" width="577" height="54"></TD>
</TR>
</TBODY>
</TABLE></body>
</html>生成一张背景为#BFD7EA 背景图片为newstop.gif的图片
有一疑问:
如何将网页放入clipboard中呢?
你写的代码只是将clipboard中的内容存入到一个bmp中,但怎么将网页读入clipboard呢?------------------------------
我是来学习的!!!!