FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour BTNBMP NOT TRASPARENT :WHY ?
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
BTNBMP NOT TRASPARENT :WHY ?
Posted: Fri Jul 10, 2009 10:33 AM


THE CODE

Code (fw): Select all Collapse
FUNCTION Main()
   LOCAL oBmp,oBmp1

 DEFINE BITMAP oBmp NAME 'Five'
DEFINE WINDOW oWnd TITLE "TESTBTN"

@ 06, 001 BTNBMP oBmp1 NAME "OROLOGIO" NOBORDER
                            oBmp1:lTransparent = .t.


ACTIVATE WINDOW oWnd ;
             ON PAINT oWnd:SayBitmap( 45, 10, oBmp )
Best Regards, Saludos



Falconi Silvio
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: BTNBMP NOT TRASPARENT :WHY ?
Posted: Fri Jul 10, 2009 10:47 AM
Hello Sylvio,

To paint another BMP on a Window-Image-Background, You need a Alpha-Blended-BMP.

Code (fw): Select all Collapse
.....
ACTIVATE WINDOW oWnd MAXIMIZED ;
ON PAINT WIN_IMAGE( oWnd, hDC ), ; 
ABPaint( hDC, 20, 20, oBmp1:hBitmap, 220 ) )  // The defined Alpha-Splash-Logo

//--------- IMAGE - LOGO ------------------------ 

STATIC FUNCTION WIN_IMAGE( oWnd, hDC ) 
LOCAL oImage1
LOCAL nWidth  := oWnd:nWidth()
LOCAL nHeight := oWnd:nHeight()

// Selected Image
// --------------------
cNEWLOGO := "&c_path\IMAGES\" + ALLTRIM(WIN_IMAGE) // Window-Background
IF File( "&cNEWLOGO" )
DEFINE IMAGE oImage1 FILENAME "&cNEWLOGO" 
   PalBmpDraw( hDC, 0, 0, oImage1:hBitmap, , nWIDTH, nHEIGHT, , .T. ) 
ELSE
MsgAlert( "Cannot load : " + CRLF + ;
   cNEWLOGO, "Error" )             
ENDIF

RETURN NIL


Today I will finish, my new Window-Background Tester.
The working of Alpha-Blended-BMP-Logos on any Screen -Position, is easy to test as well.
The Application will be for Download.

Besr Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: BTNBMP NOT TRASPARENT :WHY ?
Posted: Fri Jul 10, 2009 10:59 AM

UWE
I insert this message wrong into this forum
the message and the error is for FWPPC AND NOT FWH
I already call Antonio for this error

Best Regards, Saludos



Falconi Silvio
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: BTNBMP NOT TRASPARENT :WHY ?
Posted: Fri Jul 10, 2009 01:50 PM

Silvio,

Use TransBmp() to paint the bitmap.

Next FWPPC build provides AlphaChannel support too :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion