clear tImage
clear tImage
Hi all !
I created image
oIm:=tImage():New()
oIm:LoadBmp(cFile)
I want delete BMP from oIm. How do it ?
I created image
oIm:=tImage():New()
oIm:LoadBmp(cFile)
I want delete BMP from oIm. How do it ?
-
- Posts: 824
- Joined: Thu Oct 13, 2005 7:39 am
- Location: Germany
May be:Natter wrote:It's not work
Code: Select all | Expand
PalBmpFree( oIm:hBitMap, oIm:hPalette )
Manuel Mercado.
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact:
This is a sample:
EMG
Code: Select all | Expand
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg, oImg
DEFINE DIALOG oDlg;
SIZE 700, 500
@ 1, 1 IMAGE oImg;
FILE "SFONDO.JPG";
SIZE 200, 200;
ADJUST
@ 0, 1 BUTTON "Save";
ACTION MSGINFO( oImg:SaveImage( "SAVED.JPG", 2 ) )
@ 0, 7 BUTTON "Print";
ACTION PRINT( oImg )
@ 0, 13 BUTTON "Paste";
ACTION ( oImg:LoadFromClipboard(),;
oImg:Refresh() )
@ 0, 19 BUTTON "Load";
ACTION ( oImg:LoadImage( , "GRIGIO.JPG" ),;
oImg:Refresh() )
@ 0, 25 BUTTON "Clear";
ACTION ( PalBmpFree( oImg:hBitMap, oImg:hPalette ),;
oImg:hBitmap := 0,;
oImg:hPalette := 0,;
oImg:cResName := NIL,;
oImg:cBmpFile := NIL,;
oImg:Refresh() )
ACTIVATE DIALOG oDlg;
CENTER
RETURN NIL
STATIC FUNCTION PRINT( oImg )
LOCAL oPrn
PRINT oPrn PREVIEW MODAL
PAGE
oPrn:SayImage( 0, 0, oImg, oPrn:nHorzRes(), oPrn:nVertRes() )
ENDPAGE
ENDPRINT
RETURN NIL
EMG
- James Bott
- Posts: 4840
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
- James Bott
- Posts: 4840
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
It has. TImage is a TBitmap subclass, then inherits Destroy Method.
It is not clear if we should call the Destroy() method or the End() method. I see that TBitmap inherits from TControl which inherits from TWindow, yet I do not see the Destroy() method being called by any of those classes' End() method.
To be consistant with all the other classes, the End() method should be the one that ends the object.
James
- James Bott
- Posts: 4840
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 4 times
- Contact: