本文整理自网络,侵删。
在窗体添加一个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 十六进制字符串转化成字符串输出hextostr strtohex(Delphi版、c#版)
Delphi 判断两个时间差是否在一个指定范围内 -withinpastyears、withinpastmonths、withinpastweeks、withinpastdays
Delphi 利用tidencodermime tiddecodermime 组件字符串加密解密
更多相关阅读请进入《Delphi》频道 >>