Antonino
In method New, change this
// Add this code
::SetBitmap( cBmp1, cBmp2 )
if !Empty( ::hBitmap1 )
DEFAULT nWidth := nBmpWidth( ::hBitmap1 ) + 7
endif
if !Empty( ::hBitmap2 )
DEFAULT nWidth := nBmpWidth( ::hBitmap2 ) + 7
endif
// Remove this code
//if cBmp1 != nil
//if File( cBmp1 )
// ::hBitmap1 = ReadBitmap( 0, cBmp1 )
// ::hPalette1 = 0
//else
// ::hBitmap1 = LoadBitmap( GetResources(), cBmp1 )
// ::hPalette1 = 0
//endif
//if ::hBitmap1 == 0
// ::hBitmap1 := nil
//else
// DEFAULT nWidth := nBmpWidth( ::hBitmap1 ) + 7
//endif
//endif
//if cBmp2 != nil
//if File( cBmp2 )
// ::hBitmap2 = ReadBitmap( 0, cBmp2 )
// ::hPalette2 = 0
//else
// ::hBitmap2 = LoadBitmap( GetResources(), cBmp2 )
// ::hPalette2 = 0
//endif
//if ::hBitmap2 == 0
// ::hBitmap2 := nil
//else
// DEFAULT nWidth := nBmpWidth( ::hBitmap2 ) + 7
//endif
//endif
In Method SetBitmap, change this
METHOD SetBitmap( cBmpEnabled, cBmpDisabled ) CLASS TMsgItem
local aBmpPal
if ! Empty( cBmpEnabled )
// Remove this code
/*
if File( cBmpEnabled )
DeleteObject( ::hBitmap1 )
::hBitmap1 = ReadBitmap( 0, cBmpEnabled )
else
DeleteObject( ::hBitmap1 )
::hBitmap1 = LoadBitmap( GetResources(), cBmpEnabled )
endif
*/
// Add this code
PalBmpFree( ::hBitmap1, ::hPalette1 )
aBmpPal := FW_ReadImage( Self, cBmpEnabled, , )
::hBitmap1 := aBmpPal[ 1 ]
::hPalette1 := aBmpPal[ 2 ]
endif
if ::hBitmap1 == 0
::hBitmap1 := nil
endif
if ! Empty( cBmpDisabled )
// Remove this code
/*
if File( cBmpDisabled )
DeleteObject( ::hBitmap2 )
::hBitmap2 = ReadBitmap( 0, cBmpDisabled )
else
DeleteObject( ::hBitmap2 )
::hBitmap2 = LoadBitmap( GetResources(), cBmpDisabled )
endif
*/
// Add this code
PalBmpFree( ::hBitmap2, ::hPalette2 )
aBmpPal := FW_ReadImage( Self, cBmpDisabled, , )
::hBitmap2 := aBmpPal[ 1 ]
::hPalette2 := aBmpPal[ 2 ]
endif
if ::hBitmap2 == 0
::hBitmap2 := nil
endif
::Refresh()
return nil
An in your code, so
/*
if !empty(oMsgBar:aItems[6]:hBitmap1)
PalBmpFree(oMsgBar:aItems[6]:hBitmap1)
endif
oMsgBar:aItems[6]:hBitmap1 := oMsgBar:ReadImage("DOWNLOAD_PNG")
*/
oMsgBar:aItems[6]:SetBitmap( "DOWNLOAD_PNG", )
Please try, and tell me if run ok