本文整理自网络,侵删。
在窗体添加一个Image,一个IdHttp,一个Button
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, IdBaseComponent, IdComponent, IdTCPConnection,
IdTCPClient, IdHTTP, StdCtrls,Jpeg;
type
TForm1 = class(TForm)
Button1: TButton;
IdHTTP1: TIdHTTP;
Image1: TImage;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
imagestream:TMemoryStream;
jpg:TJpegImage;
begin
imagestream := TMemoryStream.Create();
jpg:=TJpegImage.Create;
idhttp1.Get('http://www.4936.cn/css/Code.aspx',imagestream);
imagestream.Position:=0;
jpg.LoadFromStream(imagestream);
image1.Picture.Assign(jpg);
end;
end.
相关阅读 >>
Delphi 在firemonkey应用程序中设置application.title
Delphi stringgrid 加载excel表格文件内容自动宽度
更多相关阅读请进入《Delphi》频道 >>