Hello!

Hello!

I am working on an "Add image" dialog for an HTML editor.
When I select a picture file, I would like to - you guessed it - load it into a TPicture object instance :)

This is my code:

procedure TsmAddImage.ShellLVSelectItem(Sender: TObject; Item: TListItem;
  Selected: Boolean);
begin
  inherited;
  if ExtractFileName( FileName ) <> '' then
  begin
    FPicture.LoadFromFile( FileName );
    UpdateProperties;
  end;
end;

So, when it comes to loading it raises an exception.
Jpeg and PngImage are in the uses but this happens with bitmaps as well.

Any idea? Have you ever seen something such as this?

A

Comments