Board index » cppbuilder » How to check is Image->Picture empty ?

How to check is Image->Picture empty ?


2003-12-08 11:20:25 PM
cppbuilder91
Maybe I haven't 'dug' long enough, but I cannot find any
way to check is Image->Picture empty.
There must be some elegant and easy way!
When loaded...
Image->Picture->LoadFromFile ( ... );
... and deleted
Image->Picture = NULL;
... I assumed that I can do this...
if ( Image->Picture == NULL )
DoSomethingWithBlankImage();
... but it's always != NULL!
P.S.
Image->Graphics->Bitmap has the
member function IsEmpty() I think.
Vladimir
Serbia & Montenegro
 
 

Re:How to check is Image->Picture empty ?

Thanks.
 

Re:How to check is Image->Picture empty ?

"Vladimir" < XXXX@XXXXX.COM >wrote in message
Quote
I cannot find any way to check is Image->Picture empty.
Test the Picture->Graphic for NULL first. If it is not NULL, then test its
Empty property. For example:
if( (Image1->Picture->Graphic) && (!Image1->Picture->Graphic->Empty) )
// image is not empty
else
// image is empty
Quote
... and deleted
Image->Picture = NULL;
That does not delete the Picture. But it will free the Picture's Graphic
instead.
Quote
... I assumed that I can do this...
if ( Image->Picture == NULL )
No. The Picture property is never NULL, but its Graphic property might be.
Gambit
 

{smallsort}