Page 1 of 1

Destroy HBITMAP ?

Posted: Sat Oct 22, 2022 1:47 pm
by Jimmy
hi,

i want to use HB_FUNC(RESIZEBMP) and ::oWnd:ReadImage() which both "produce" hBitmap

Question : do i need to "Destroy" hBitmap :?:

if Yes, how under Fivewin

Code: Select all | Expand

  aBitmaps := ::oWnd:ReadImage( ::cPath + cFile, { ::nIcoLarge*2, ::nIcoLarge*2 } )
   iImage := aBitmaps[ 1 ]
   iImage := RESIZEBMP( iImage, ::nIcoLarge, ::nIcoLarge, .T. )
   iImage := MAX( 0, ILADD( ::oImageListBig:hImageList, iImage ) )
   // after add to Imagelist what to do with iImage ?

Re: Destroy HBITMAP ?

Posted: Mon Oct 24, 2022 8:23 am
by nageswaragunupudi
for hBitmap,

Code: Select all | Expand

DeleteObject( hBitmap )


Result of FW_ReadImage(...) is an array, whose first 2 elements are { hBitmap, hPallette, ....... }

Use

Code: Select all | Expand

PalBmpFree( aImage )

Re: Destroy HBITMAP ?

Posted: Mon Oct 24, 2022 9:08 am
by Jimmy
hi,
nageswaragunupudi wrote:for hBitmap,

Code: Select all | Expand

Delete Object( hBitmap )
PalBmpFree( aImage )

thx, i will include it in my Demo Sample

... em, äh

Code: Select all | Expand

Delete Object( hBitmap )

need a HB_FUNC() and what Type of Parameter :?:

Re: Destroy HBITMAP ?

Posted: Mon Oct 24, 2022 3:20 pm
by nageswaragunupudi
DeleteObject
not
Delete Object

Re: Destroy HBITMAP ?

Posted: Tue Oct 25, 2022 5:15 am
by nageswaragunupudi
for icons, please use

DestroyIcon( hIcon )

Re: Destroy HBITMAP ?

Posted: Tue Oct 25, 2022 8:46 am
by Jimmy
hi,

ok, thx