Page 1 of 1

How to clear an oImage

Posted: Wed Jul 11, 2007 12:53 pm
by Ollie
When I hit the "Clear" button I still see the image - I want it to be blank.

Code: Select all

   REDEFINE IMAGE oImage ID 4010 OF oDlg_Edit_Line FILE cImage WHEN FILE(cImage) ADJUST UPDATE
   //Load image button below
   REDEFINE BUTTON ID 4011 OF oDlg_Edit_Line ACTION ;
   ( cImage := cGetFile32("Images (*.jpg) | *.jpg |" + "All files (*.*) | *.* |", "Select an image file" ),;
   IF(FILE(cImage),(oImage:cBmpFile:=cImage,oImage:Reload(),oImage:Refresh()),NIL))
   //CLear image button below
   REDEFINE BUTTON ID 4026 OF oDlg_Edit_Line ACTION (cImage:="",oImage:cBmpFile:=cImage,oImage:Destroy(),oImage:Refresh())

Posted: Wed Jul 11, 2007 6:24 pm
by antolin
Try this: oImage:Hide() + oImage:End() + oImage := NIL + SysRefresh()

Regards

Posted: Thu Jul 12, 2007 6:34 am
by Ollie
Thank you. oImage:Hide() gave me what I was looking for.