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);
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
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