Mega Code Archive

 
Categories / Delphi / Graphic
 

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

Title: How to easily load all kind of images (Gif, Ico, Jpeg and more) in a TImage 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;