HI, i need an sample to put an gradient (degrade) gray in main window (mdi) and an transparente bitmap or with an text raised, someone has an sample??
very thanks
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oWnd
DEFINE WINDOW oWnd MDI
ACTIVATE WINDOW oWnd;
ON PAINT GRADIENT( oWnd, hDC )
RETURN NIL
STATIC FUNCTION GRADIENT( oWnd, hDC )
LOCAL aRect := GETCLIENTRECT( oWnd:hWnd )
LOCAL nStep := ( aRect[ 3 ] - aRect[ 1 ] ) / 256
LOCAL oBrush
LOCAL i
aRect[ 3 ] = nStep
FOR i = 255 TO 0 STEP -1
DEFINE BRUSH oBrush;
COLOR RGB( i, i, i )
FILLRECT( hDC, aRect, oBrush:hBrush )
RELEASE BRUSH oBrush
aRect[ 1 ] += nStep
aRect[ 3 ] += nStep
NEXT
RETURN NIL
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oWnd, hBmp, oFnt
DEFINE WINDOW oWnd MDI
hBmp = READBITMAP( 0, "\FWH\BITMAPS\INSTALL.BMP" )
DEFINE FONT oFnt NAME "Arial" SIZE 0, -20
ACTIVATE WINDOW oWnd;
ON PAINT ( GRADIENT( oWnd, hDC ),;
IF( hBmp != 0, DRAWMASKED( hDC, hBmp, 200, 200 ), ),;
oWnd:oWndClient:Say( 20, 10, "This is a test", CLR_HRED, , oFnt, , .T. ) )
IF hBmp != 0; DELETEOBJECT( hBmp ); ENDIF
RELEASE FONT oFnt
RETURN NIL
STATIC FUNCTION GRADIENT( oWnd, hDC )
LOCAL aRect := GETCLIENTRECT( oWnd:hWnd )
LOCAL nStep := ( aRect[ 3 ] - aRect[ 1 ] ) / 256
LOCAL oBrush
LOCAL i
aRect[ 3 ] = nStep
FOR i = 255 TO 0 STEP -1
DEFINE BRUSH oBrush;
COLOR RGB( i, i, i )
FILLRECT( hDC, aRect, oBrush:hBrush )
RELEASE BRUSH oBrush
aRect[ 1 ] += nStep
aRect[ 3 ] += nStep
NEXT
RETURN NIL
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg, hBmp, oFnt, oRadio, oCheck, nValue := 1, lCheck := .F., oCheck1, lCheck1 := .F., oGet, cGet := SPACE(50)
DEFINE DIALOG oDlg SIZE 250, 250 TRANSPARENT
hBmp = READBITMAP( 0, "\FWH\BITMAPS\INSTALL.BMP" )
DEFINE FONT oFnt NAME "Arial" SIZE 0, -20
@ 1.75,0 RADIO oRadio VAR nValue ITEMS "Radio&1 not OK", "&Rado&2 not OK" OF oDlg SIZE 60, 12
@ 1.65,09 CHECKBOX oCheck VAR lCheck PROMPT "CheckBox&1 not OK" OF oDlg SIZE 80,12
@ 2.50,09 CHECKBOX oCheck1 VAR lCheck1 PROMPT "CheckBox&2 not OK" OF oDlg SIZE 80,12
ACTIVATE DIALOG oDlg CENTERED ;
ON PAINT ( GRADIENT( oDlg, hDC ),;
IF( hBmp != 0, DRAWMASKED( hDC, hBmp, 65, 65 ), ),; //,;
oDlg:Say( 1, 1, "This Say is OK", CLR_HRED, , oFnt, , .T. ), SysRefresh() )
IF hBmp != 0; DELETEOBJECT( hBmp ); ENDIF
RELEASE FONT oFnt
RETURN NIL
STATIC FUNCTION GRADIENT( oDlg, hDC )
LOCAL aRect := GETCLIENTRECT( oDlg:hWnd )
LOCAL nStep := ( aRect[ 3 ] - aRect[ 1 ] ) / 256
LOCAL oBrush
LOCAL i
aRect[ 3 ] = nStep
FOR i = 255 TO 0 STEP -1
DEFINE BRUSH oBrush;
COLOR RGB( i, i, i )
FILLRECT( hDC, aRect, oBrush:hBrush )
RELEASE BRUSH oBrush
aRect[ 1 ] += nStep
aRect[ 3 ] += nStep
NEXT
RETURN NIL
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 38 guests