Board index » delphi » Loading images at run time Help

Loading images at run time Help

I need to load images when a user has selected from a list box. Depending on
what they choose that particular image will load

 

Re:Loading images at run time Help


Quote
Charl wrote in message ...
>I need to load images when a user has selected from a list box. Depending
on
>what they choose that particular image will load

Re:Loading images at run time Help


procedure TForm1.FileListBox1Click(Sender: TObject);
var
  bm : TBitmap;
begin
  bm := TBitmap.Create;
  if FileListBox1.Items.Count > 0 then
    bm.LoadFromFile(FileListBox1.Items[FileListBox1.ItemIndex]);
  {do something with bmp}
end;

or, if using a TImage:

  Image1.Picture.LoadFromFile(a.valid.filename);

HTH...

Quote
Charl wrote in message <6fbs53$bf...@plug.news.pipex.net>...
>I need to load images when a user has selected from a list box. Depending
on
>what they choose that particular image will load

Other Threads