balrom
asked on
Assign a bitmap to a picture from an imagelist
Hi Experts,
I have an imagelist with some preloaded images.
At runtime i want to show different status of my application using a Timage component.
What is the correct way to assign to the TPicture an image from the imagelist?
Best regards
I have an imagelist with some preloaded images.
At runtime i want to show different status of my application using a Timage component.
What is the correct way to assign to the TPicture an image from the imagelist?
Best regards
ASKER
Oh, a solution from the top expert....
Thank you kretzschmar, i've done the assignment suggested, it work but the new image is not repainted, this happen only when i force the redraw of the form (eg. by minimising/maximizing form).
Any idea?
Thank you kretzschmar, i've done the assignment suggested, it work but the new image is not repainted, this happen only when i force the redraw of the form (eg. by minimising/maximizing form).
Any idea?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ok i've tryed this:
imagelist1.GetBitmap(Index , image1.picture.bitmap);
image1.refresh;
and works fine.
Thank you kretzschmar.
imagelist1.GetBitmap(Index
image1.refresh;
and works fine.
Thank you kretzschmar.
well, glad you got it work :-))
ASKER
In some cases, using the solution posted above, i've verified that the images are not drawn correctly.
The best solution is a mix of the solutions gived by kretzschmar:
image1.picture := nil;
imagelist1.GetBitmap(Index , image1.picture.bitmap);
image1.refresh;
This works always.
Regards
The best solution is a mix of the solutions gived by kretzschmar:
image1.picture := nil;
imagelist1.GetBitmap(Index
image1.refresh;
This works always.
Regards
imagelist1.GetBitmap(Index
not tested
meikl ;-)