Link to home
Start Free TrialLog in
Avatar of roosiedb
roosiedb

asked on

Change picture in a Image.

I want to change the picture in a Image. This stuff doesn't work:
Image1.Picture:='new.bmp';
Why doesn't that work? And how do I have to do such a job?
Thanx. A Beginning Delphi-developper.
roosiedb@worldaccess.nl
ASKER CERTIFIED SOLUTION
Avatar of mikepj
mikepj
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sabog7
sabog7

to roosiedb

    try this code

procedure TForm1.FormCreate(Sender: TObject);
begin
filelistbox1.ApplyFilePath('c:\***  ');
end;
{**** name of the directory where your BMP is located}

procedure TForm1.FileListBox1Click(Sender: TObject);
begin
image1.picture.LoadFromFile(filelistbox1.filename);
end;

to roosiedb

    try this code

procedure TForm1.FormCreate(Sender: TObject);
begin
filelistbox1.ApplyFilePath('c:\***  ');
end;
{**** name of the directory where your BMP is located}

procedure TForm1.FileListBox1Click(Sender: TObject);
begin
image1.picture.LoadFromFile(filelistbox1.filename);
end;