Did you already tried using only a window and only a dialog? What are the results?
EMG
FUNCTION PAINT_LOGO()
/*
// INCLUDE-Info
// ----------------
@ <nRow>, <nCol> Image [ <oBmp> ] ;
[ <resource: NAME, RESNAME, RESOURCE> <cResName> ] ;
[ <file: FILE, FILENAME, DISK> <cBmpFile> ] ;
[ <NoBorder:NOBORDER, NO BORDER> ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ <of: OF, WINDOW, DIALOG> <oWnd> ] ;
[ <lClick: ON CLICK, ON LEFT CLICK> <uLClick> ] ;
[ <rClick: ON RIGHT CLICK> <uRClick> ] ;
[ <scroll: SCROLL> ] ;
[ <adjust: ADJUST> ] ;
[ CURSOR <oCursor> ] ;
[ <pixel: PIXEL> ] ;
[ MESSAGE <cMsg> ] ;
[ <update: UPDATE> ] ;
[ WHEN <uWhen> ] ;
[ VALID <uValid> ] ;
[ <lDesign: DESIGN> ] ;
*/
IF lVisible = .T. // close for Repainting
oLogo:End()
ELSE // on first Start, get original Logo-size
DEFINE IMAGE oImage FILENAME c_path + "\Images\" + cWLogo
aLogo[1] := aLogo[1] // Top-pos. on Start
aLogo[2] := aLogo[2] // Left-pos on Start
aLogo[3] := oImage:nWidth
aLogo[4] := oImage:nHeight
oImage:End()
ENDIF
lVisible := .T.
@ aLogo[1], aLogo[2] IMAGE oLogo ;
FILENAME c_Path + "\Images\" + cWLogo ;
NOBORDER ;
SIZE aLogo[3], aLogo[4] ;
OF oWnd ;
PIXEL ;
UPDATE ;
DESIGN ;
TRANSPARENT
oLogo:SetFocus()
oLogo:bMoved := {|| ( aLogo[1] := oLogo:nTop(), ; // Top
aLogo[2] := oLogo:nLeft(), ; // Left
aLogo[3] := oLogo:nWidth(), ;
aLogo[4] := oLogo:nHeight() ) }
oLogo:bResized := {|| ( aLogo[1] := oLogo:nTop(), ; // Top
aLogo[2] := oLogo:nLeft(), ; // Left
aLogo[3] := oLogo:nWidth(), ;
aLogo[4] := oLogo:nHeight() ) }
oLogo:bRClicked := {|| MsgAlert( ( "Top : " + ALLTRIM(STR(oLogo:nTop())) + CRLF + ;
"Left : " + ALLTRIM(STR(oLogo:nLeft())) + CRLF + ;
"Width : " + ALLTRIM(STR(oLogo:nWidth())) + CRLF + ;
"Height : " + ALLTRIM(STR(oLogo:nHeight())) ), "Logo - Pos. and Size" ) }
RETURN ( NIL )
// -------- WINDOW - Background ---------------
FUNCTION W_BACKGRD( oWnd, nStyle, lDirect, nColor1, nColor2, nMove, cBrush, cImage )
local oBrush
IF nStyle = 1 // COLOR
DEFINE BRUSH oBrush COLOR nColor1
// FillRect( oBitmap:hDC, aRect, oNewbrush:hBrush )
ENDIF
IF nStyle = 2 // GRADIENT
aGrad := { { nMove, nColor1, nColor2 }, { nMove, nColor2, nColor1 } }
hDC = CreateCompatibleDC( oWnd:GetDC() )
hBmp = CreateCompatibleBitMap( oWnd:hDC, oWnd:nWidth, oWnd:nHeight )
hBmpOld = SelectObject( hDC, hBmp )
GradientFill( hDC, 0, 0, oWnd:nHeight, oWnd:nWidth, aGrad, lDirect )
DeleteObject( oWnd:oBrush:hBrush )
oBrush := TBrush():New( ,,,, hBmp )
oBrush:Cargo := aGrad
SelectObject( hDC, hBmpOld )
ReleaseDC(hDC)
ENDIF
IF nStyle = 3 // BMP-BRUSH
DEFINE BRUSH oBrush FILE c_path + "\Images\" + cBrush
ENDIF
IF nStyle = 4 // Image ADJUSTED
DEFINE IMAGE oImage FILE c_path + "\Images\" + cImage
oBrush := TBrush():new( ,,,, ResizeBmp( oImage:hBitmap, oWnd:nWidth, oWnd:nHeight , .T. ) )
oImage:End()
ENDIF
oWnd:SetBrush( oBrush )
oBrush:End()
RETURN( NIL )
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 34 guests