 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Blake Young Guest
|
Posted: Fri May 07, 2004 4:06 pm Post subject: closing a TImage bitmap |
|
|
I'm writing a program where a user can click Browse, locate a BMP file, and
then click OK and the picture will load into my Image1 object and be
displayed on the screen. (There will obviously be manipulations done on the
image, but that's not important.) However, how can I allow the user to
"close" the image? I've tried various functions on Image1, but they either
do not work or they throw exceptions. Ideally, when the user clicks Close,
the memory allocated for the bitmap will be released and the bitmap will no
longer be displayed, but the Image1 object will still be there able to
accept another image as soon as the user clicks Browse and locates another
BMP.
Thanks.
|
|
| Back to top |
|
 |
Damon Chandler (TeamB) Guest
|
Posted: Sun May 09, 2004 4:27 pm Post subject: Re: closing a TImage bitmap |
|
|
Hi,
To free the bitmap, just set the TImage::Picture property to NULL...
Image1->Picture = NULL;
This call will instruct the TPicture class to delete its TGraphic object
(TBitmap, in your case).
HTH,
--
Damon (TeamB)
Blake Young wrote:
| Quote: | I'm writing a program where a user can click Browse, locate a BMP file, and
then click OK and the picture will load into my Image1 object and be
displayed on the screen. However, how can I allow the user to
"close" the image?
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|