BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

closing a TImage bitmap

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics)
View previous topic :: View next topic  
Author Message
Blake Young
Guest





PostPosted: Fri May 07, 2004 4:06 pm    Post subject: closing a TImage bitmap Reply with 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. (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





PostPosted: Sun May 09, 2004 4:27 pm    Post subject: Re: closing a TImage bitmap Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.