WebBrowser 中有个Form表单,里面有文字和图片, 我想问下如何能完整的获取Form里面的内容呢(文字我已经知道如何获取,关键是图片不知道如何获取)
我想把这个Form表单里的内容复制到另外一个WebBrowser里
我想把这个Form表单里的内容复制到另外一个WebBrowser里
解决方案 »
- Delphi 2010 一年授权许可
- 如何让文件夹中的所有图片打包上传到指定的邮箱中?
- 关于 DELPHI的ActionList~~~~~
- 想问一下delphi开发的网络通信方面的软件是怎么通信的?
- delphi 7的常用组件突然没了,急……
- 想跳槽,但如果因面试等频频请假似乎不太好,大家是怎么解决这个问题的?
- 一个奇怪的问题,谁能帮帮我?谢谢...
- 请教两个Form中数据关联的问题 :)
- 请问frReport1中的条码Bar1,要怎样才能在程序中对她赋值呢?也就是说这个条码随这一个变量的改变而改变,,
- 难道电脑中真的有幽灵存在?
- DELPHI fastreport 人民币大写问题
- 自绘菜单时,如何取得菜单项的信息
ms:TMemoryStream;
begin
ms:=TMemoryStream.Create;
IdHTTP1.Get('www.xx.com/1.jpg',ms);
ms.Position:=0;
ms.SaveToFile('D:\1.jpg');
ms.Free;
end;
interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP, StdCtrls;type TForm1 = class(TForm)
Button1: TButton;
IdHTTP1: TIdHTTP;
procedure Button1Click(Sender: TObject);
end;var Form1: TForm1;
implementation{$R *.dfm}uses jpeg;procedure TForm1.Button1Click(Sender: TObject);
const
url = 'http://ptlogin2.qq.com/getimage?aid=15000701&0.9129723031485226';
var
ms: TMemoryStream;
jpg: TJPEGImage;
begin
ms := TMemoryStream.Create; jpg := TJPEGImage.Create; IdHTTP1.Get(url, ms);
ms.Position := 0;
jpg.LoadFromStream(ms);
Canvas.Draw(10, 10, jpg);
jpg.Free;
ms.Free;
end;end.
var
i:Integer;
rang:IHTMLControlRange;
s:string;
begin
try
s := (IHTMLDocument2(wb.Document).images.item('pic',EmptyParam) as IHTMLElement).getAttribute('src',0);
//showmessage(s);
rang:=((IHTMLDocument2(wb.Document).body as HTMLBody).createControlRange)as
IHTMLControlRange;
rang.add(IHTMLDocument2(wb.Document).images.item('pic',EmptyParam)as
IHTMLControlElement);
rang.execCommand('Copy',False,0);
image1.Picture.Assign(ClipBoard);
except
end;
end;