Estimados
Es posible que los botones de RIBON pueda usar imagen PNG
ya que son mas vistosos actualmente los paso a bmp
Function CargaImgBtt( cFile , oButton )
Local lSw := .F.
Local cExt := ""
if !empty( cFile )
cExt := Right( Upper( cFile ), 3 )
if cExt = "BMP"
if !empty( oButton )
//? cFile
oButton:LoadBitmaps( cFile )
lSw := .T.
endif
else
if !empty( oButton )
oButton:hBitmap1 := FWOpenPngFile( cFile )
lSw := .T.
endif
endif
if lSw
oButton:HasAlpha( oButton:hBitmap1, BTN_UP )
oButton:Refresh()
endif
endif
Return lSw
METHOD LoadBitmaps( cName ) CLASS TRBtn
local aBmpPal
if ! Empty( cName )
if ! File( cName )
aBmpPal = PalBmpLoad( cName )
::hBitmap1 = aBmpPal[ 1 ]
::hPalette1 = aBmpPal[ 2 ]
::HasAlpha( ::hBitmap1 )
else
::cName = cName
if upper(right(cName,3))="PNG"
::hBitmap1 = FWOpenPngFile( cName )
::hPalette1 = 0
::HasAlpha( ::hBitmap1 )
else
aBmpPal = PalBmpRead( ::GetDC(), cName )
::hBitmap1 = aBmpPal[ 1 ]
::hPalette1 = aBmpPal[ 2 ]
::ReleaseDC()
endif
endif
endif
if ! Empty( ::hBitmap1 )
PalBmpNew( ::hWnd, ::hBitmap1, ::hPalette1 )
endif
return nil
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 108 guests