BtnBmp with Alpha Channel

BtnBmp with Alpha Channel

Postby Daniel Garcia-Gil » Fri Mar 27, 2009 4:49 am

I present another possible contribution, again presenting the prototype of what would change ...

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
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 79 guests