As discussed the matter on Alpha Channel to start implementing FW classes
the general idea, just as we use the clause TRANSPARENT, i added ALPHA clause to say that we will use the features of a bitmap with Alpha Channel, this feature requires an amount of transparency (0-255), I have added a LEVEL clause to determine the percentages that transparency (0-100%), do not use 0-255, only number that expresses the percentage.
Class TBTNBMP currently used by the 3 images (1-Status Normal, 2-Button pressed, 3-Button Disabled) for the next build, was added 4th image that will be used when the mouse cross over button
by the use of these images have all the individual transparencies
example
@ X, y btnbmp .... ALPHA LEVEL 0,10,10,0 we can add transparency percentage to each image, by default would be 0% transparency ...
No more words to leave them with an example
I am attentive to the opinions and suggestions
http://www.sitasoft.com/fivewin/test/testbtb2.rar
- Code: Select all Expand view
- #include "fivewin.ch"
#include "Slider.ch"
procedure main()
local oDlgw
local oBot01
local oBar, oBotBar0, oBotBar1
local nVar1 := 80 // transparence porcent
local oSlide
local lChk1 := .f.
local lChk2 := .f.
SetBalloon( .t. )
DEFINE dialog oDlgw TITLE "Test BTNBMP Alpha Channel" from 0,0 to 600,700 pixel
@ 50, 5 BTNBMP oBot01 OF oDlgw SIZE 80, 80 tooltip "BTNBMP With Alpha Channel" ;
file "..\bitmaps\explorer.bmp",nil,nil,"..\bitmaps\imac.bmp" alpha level nVar1,,,20
@ 180, 5 checkbox lChk1 prompt "Adjust Image " of oDlgw pixel on change ( oBot01:lAdjust := lChk1, oBot01:refresh() )
@ 200, 5 checkbox lChk2 prompt "2007 Style " of oDlgw pixel on change ( oBot01:l2007 := lChk2, oBot01:refresh() )
@ 50, 300 SLIDER oSlide VAR nVar1 OF oDlgw ;
VERTICAL ;
RIGHT DIRECTION ;
RANGE 1, 100 ;
MARKS 1;
EXACT;
ON CHANGE ( oBot01:aLevel[ 1 ] := nVar1, oBot01:refresh() ) ;
SIZE 42, 160 PIXEL
ACTIVATE dialog oDlgw
return