Destroy HBITMAP ?

Destroy HBITMAP ?

Postby Jimmy » Sat Oct 22, 2022 1:47 pm

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 view
  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 ?
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Destroy HBITMAP ?

Postby nageswaragunupudi » Mon Oct 24, 2022 8:23 am

for hBitmap,

Code: Select all  Expand view
DeleteObject( hBitmap )


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

Use
Code: Select all  Expand view
PalBmpFree( aImage )
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10625
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Destroy HBITMAP ?

Postby Jimmy » Mon Oct 24, 2022 9:08 am

hi,
nageswaragunupudi wrote:for hBitmap,
Code: Select all  Expand view
Delete Object( hBitmap )
PalBmpFree( aImage )

thx, i will include it in my Demo Sample

... em, äh
Code: Select all  Expand view
Delete Object( hBitmap )

need a HB_FUNC() and what Type of Parameter :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Destroy HBITMAP ?

Postby nageswaragunupudi » Mon Oct 24, 2022 3:20 pm

DeleteObject
not
Delete Object
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10625
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Destroy HBITMAP ?

Postby nageswaragunupudi » Tue Oct 25, 2022 5:15 am

for icons, please use

DestroyIcon( hIcon )
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10625
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Destroy HBITMAP ?

Postby Jimmy » Tue Oct 25, 2022 8:46 am

hi,

ok, thx
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 56 guests