VistaMenu new feature
Posted: Fri Oct 19, 2012 8:26 am
Dear Antonio, Dear Paco,
I add on Vistamenu Class an feature to show an image trasparent at the end of vistamenu window
I take this feature from another class of our Big Friend Paco I have and I think there 's no problems to pubblished it to our community.
I add two DATA
DATA cWatermark
DATA nWTrans
the first is the name of the bitmap, the second is a numeric value to set the transparency of this logo
I add a new method METHOD DrawTraspLogo()
on the Paint method after the line FillSolidRect( hDCMem, rc, ::nClrPane )
I add this commands
if !Empty(::cWatermark )
:: DrawTraspLogo(hDCMem)
ENDIF
I add this method
METHOD DrawTraspLogo(hDCMem) CLASS TVistaMenu
Local hWater,nW,nH,nT,nB,nR
if !Empty(::cWatermark )
hWater := LoadImageEx( ::cWatermark )
if hWater != 0
nW := BmpWidth ( hWater )
nH := BmpHeight( hWater )
nT := ::nHeight - nH-1 -10
nL := ::nWidth - nW-1 -25 //????
nB := nT + nH
nR := nL + nW
DrawAlphaTransparentBitmap( hDCMem, hWater, {nT,nL,nB,nR}, ::nWTrans, RGB(255,0,255) )
DeleteObject( hWater )
endif
endif
return 0
to make a test you must add on .\samples\vistamn1.prg :
oVMenu := TVistaMenu():New( 0,0, 100, 100, oWnd )
oVMenu:nColumns := 2
oVMenu:nType := 2
oVMenu:cWatermark:=".\bitmaps\logo.bmp"
oVMenu:nWTrans :=180
It run ok only when I select a Item on Vistamenu the item not is trasparent when exit the logo at left
I add on Vistamenu Class an feature to show an image trasparent at the end of vistamenu window
I take this feature from another class of our Big Friend Paco I have and I think there 's no problems to pubblished it to our community.
I add two DATA
DATA cWatermark
DATA nWTrans
the first is the name of the bitmap, the second is a numeric value to set the transparency of this logo
I add a new method METHOD DrawTraspLogo()
on the Paint method after the line FillSolidRect( hDCMem, rc, ::nClrPane )
I add this commands
if !Empty(::cWatermark )
:: DrawTraspLogo(hDCMem)
ENDIF
I add this method
METHOD DrawTraspLogo(hDCMem) CLASS TVistaMenu
Local hWater,nW,nH,nT,nB,nR
if !Empty(::cWatermark )
hWater := LoadImageEx( ::cWatermark )
if hWater != 0
nW := BmpWidth ( hWater )
nH := BmpHeight( hWater )
nT := ::nHeight - nH-1 -10
nL := ::nWidth - nW-1 -25 //????
nB := nT + nH
nR := nL + nW
DrawAlphaTransparentBitmap( hDCMem, hWater, {nT,nL,nB,nR}, ::nWTrans, RGB(255,0,255) )
DeleteObject( hWater )
endif
endif
return 0
to make a test you must add on .\samples\vistamn1.prg :
oVMenu := TVistaMenu():New( 0,0, 100, 100, oWnd )
oVMenu:nColumns := 2
oVMenu:nType := 2
oVMenu:cWatermark:=".\bitmaps\logo.bmp"
oVMenu:nWTrans :=180
It run ok only when I select a Item on Vistamenu the item not is trasparent when exit the logo at left