'DATA' hAlphaLevel (Resolved)

'DATA' hAlphaLevel (Resolved)

Postby arthursilvestre » 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
Last edited by arthursilvestre on Thu Jul 11, 2013 4:50 pm, edited 2 times in total.
User avatar
arthursilvestre
 
Posts: 32
Joined: Thu Sep 20, 2012 7:29 pm

Re: Antonio Liniares

Postby Otto » Thu Jul 11, 2013 1:39 pm

Hello arthursilvestre,
please use a topic which is related to the content.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: hAlphaLevel Control

Postby arthursilvestre » Thu Jul 11, 2013 1:51 pm

Edited, thks
User avatar
arthursilvestre
 
Posts: 32
Joined: Thu Sep 20, 2012 7:29 pm

Re: 'DATA' hAlphaLevel

Postby fafi » Thu Jul 11, 2013 2:48 pm

Code: Select all  Expand view

#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
User avatar
fafi
 
Posts: 169
Joined: Mon Feb 25, 2008 2:42 am

Re: 'DATA' hAlphaLevel

Postby arthursilvestre » Thu Jul 11, 2013 4:49 pm

Perfect, Thanks. I really appreciate the help.
User avatar
arthursilvestre
 
Posts: 32
Joined: Thu Sep 20, 2012 7:29 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 82 guests