Arsip: easily load all kind of images (Gif, Ico, Jpeg and more) in a TImage


by kaka-delphi in Articles more 13 years ago 2229
Mungkin trik ini udah ada(Emang udah coba liat di sini), tapi paksain aja yach..
uses axCtrls
...procedure TForm1.Button1Click(Sender: TObject);
var
OleGraphic: TOleGraphic;
fs: TFileStream;
begin
try
OleGraphic := TOleGraphic.Create;
fs     := TFileStream.Create('C:\\...\\test.gif', fmOpenRead or fmSharedenyNone);
OleGraphic.LoadFromStream(fs);
SampleImage.Picture.Assign(OleGraphic);
finally
fs.Free;
OleGraphic.Free
end;
end;
Syntax Highlighted with https://pascal-id.org/syntax
Local Business Directory, Search Engine Submission & SEO Tools FreeWebSubmission.com SonicRun.com