Anfidya'nın arka bahçesi..

There is dark web in the deep web..

[Delphi] İnternetteki resmi image nesnesine çekme

2 comments

Merhaba,

Aşağıda ki kod ile kolayca nette ki resmi programımızda göstereceğiz.

Uses:

IdHTTP,Classes,jpeg;

Kodumuz:

procedure res_cek(url:string,image:timage);
var
 MS : TMemoryStream;
 jpg : TJPEGImage;
 http : TidHTTP;
begin
 MS := TMemoryStream.Create;
 jpg := TJPEGImage.Create;
 http := tidhttp.create;
 try
  http.get(url,MS);
  Ms.Seek(0,soFromBeginning);
  jpg.LoadFromStream(MS);
  Image.Picture.Assign(jpg);
 finally
  FreeAndNil(jpg);
  FreeAndNil(MS);
  FreeAndNil(http);
 end;
end;

Kullanımı:

res_cek('http://img3.wikia.nocookie.net/__cb20130804012914/zootycoon/images/0/09/Bengal_tiger.jpg',image1);

Written by anfidya

Eylül 27th, 2014 at 3:26 pm

Posted in Delphi

Tagged with ,

2 Responses to '[Delphi] İnternetteki resmi image nesnesine çekme'

Subscribe to comments with RSS or TrackBack to '[Delphi] İnternetteki resmi image nesnesine çekme'.

  1. Also, the image that I am using is a PNG. Would that affect the code ( I have alreday tried replacing jpg eith png )?I am using a child theme of twenty eleven by the way

    Veri

    20 Haz 15 at 08:17

  2. Delphi 7 is not support PNG files. You have to use external components. And what is your Delphi version?

    anfidya

    22 Ağu 15 at 17:06

Leave a Reply

*