FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour 'DATA' hAlphaLevel (Resolved)
Posts: 32
Joined: Thu Sep 20, 2012 07:29 PM

'DATA' hAlphaLevel (Resolved)

Posted: Thu Jul 11, 2013 12:25 PM

Linhares, I hope I'm not bothering or.
Could you take a doubt? How can I work with the 'DATA' hAlphaLevel?

Example, if I want to create a window or dialog where it will only contain a bitmap, but I would like the dialog or window was 100% transparent but not bitmap. And I would like the bitmap was a star where the white parts of the bitmap would be transparent.

There is that possibility?

Note: whatever be bitmap, jpeg or png.

EX picture: http://upload.wikimedia.org/wikipedia/c ... branco.PNG

Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM

Re: Antonio Liniares

Posted: Thu Jul 11, 2013 01:39 PM

Hello arthursilvestre,
please use a topic which is related to the content.
Best regards,
Otto

Posts: 32
Joined: Thu Sep 20, 2012 07:29 PM

Re: hAlphaLevel Control

Posted: Thu Jul 11, 2013 01:51 PM

Edited, thks

Posts: 169
Joined: Mon Feb 25, 2008 02:42 AM

Re: 'DATA' hAlphaLevel

Posted: Thu Jul 11, 2013 02:48 PM
Code (fw): Select all Collapse
#include "Fivewin.ch" 


FUNCTION MAIN() 

      MSGLOGO( "star.bmp", 5 ) 

RETURN NIL 


FUNCTION MSGLOGO( cImage, nSeconds ) 

    LOCAL oDlg, oTimer, oImage 

    DEFAULT nSeconds := 5 

    DEFINE DIALOG oDlg; 
           SIZE 800, 600; 
           STYLE WS_POPUP; 
           BRUSH TBrush():New( "NULL" ) 

    DEFINE TIMER oTimer OF oDlg; 
           INTERVAL nSeconds * 1000; 
           ACTION oDlg:End() 

    @ 0, 0 IMAGE oImage; 
           FILE cImage; 
           SIZE 800, 600; 
           NOBORDER 

    oImage:lTransparent = .T. 

    ACTIVATE DIALOG oDlg; 
             ON INIT ( oTimer:hWndOwner := oDlg:hWnd,; 
                       oTimer:Activate(),; 
                       SETTRANSP( oDlg ) ); 
             CENTER 

    RETURN NIL 


#define LWA_COLORKEY 1 

#define GWL_EXSTYLE -20 

#define WS_EX_LAYERED 524288 


STATIC FUNCTION SETTRANSP( oDlg ) 

    SETWINDOWLONG( oDlg:hWnd, GWL_EXSTYLE, NOR( GETWINDOWLONG( oDlg:hWnd, GWL_EXSTYLE ), WS_EX_LAYERED ) ) 

    SETLAYEREDWINDOWATTRIBUTES( oDlg:hWnd, , , LWA_COLORKEY ) 

    RETURN NIL


Regards
Fafi
Posts: 32
Joined: Thu Sep 20, 2012 07:29 PM

Re: 'DATA' hAlphaLevel

Posted: Thu Jul 11, 2013 04:49 PM

Perfect, Thanks. I really appreciate the help.

Continue the discussion