Como utilizar resources PNG de um resource ?
yo posso hacer una dialog transparent and add um PNG file ?
Sample: ( isso nao funciona... )
- Code: Select all Expand view
// Moving a window, with the mouse, without a caption
#include "FiveWin.ch"
function Main()
local oWnd, nRowPos, nColPos, lDrag := .F., oCrsHand, oBmp
DEFINE CURSOR oCrsHand HAND
DEFINE BITMAP oBmp FILENAME "test.png"
DEFINE WINDOW oWnd STYLE WS_POPUP COLOR "W/R"
oWnd:bLClicked := { | nRow, nCol | nRowPos := nRow, nColPos := nCol, lDrag := .T., oWnd:oCursor := oCrsHand }
oWnd:bMMoved = { | nRow, nCol | If( lDrag, oWnd:Move( oWnd:nTop + nRow - nRowPos,;
oWnd:nLeft + nCol - nColPos,,, .T. ),) }
oWnd:bLButtonUp := { || lDrag := .F., oWnd:oCursor := nil }
oWnd:SetSize( 221, 221 )
oWnd:Center()
ACTIVATE WINDOW oWnd ;
ON INIT SetTransparent( oWnd ) ;
ON PAINT PaintTransparent( hDC, oBmp:hBitmap, 0, 0 ) ;
ON RIGHT CLICK oWnd:End()
oBmp:End()
return nil
#define LWA_COLORKEY 1
#define GWL_EXSTYLE -20
#define WS_EX_LAYERED 524288
STATIC FUNCTION SETTRANSPARENT( oDlg )
SETWINDOWLONG( oDlg:hWnd, GWL_EXSTYLE, NOR( GETWINDOWLONG( oDlg:hWnd, GWL_EXSTYLE ), WS_EX_LAYERED ) )
SETLAYEREDWINDOWATTRIBUTES( oDlg:hWnd, CLR_RED,, LWA_COLORKEY )
RETURN NIL
function PaintTransparent( hDC, hBitmap, nRow, nCol )
local hBmpOld := SelectObject( hDC, hBitmap )
local nZeroZeroClr := GetPixel( hDC, 0, 0 )
local nOldClr
SelectObject( hDC, hBmpOld )
nOldClr = SetBkColor( hDC, nRGB( 255, 255, 255 ) )
TransBmp( hBitmap, nBmpWidth( hBitmap ), nBmpHeight( hBitmap ),;
nZeroZeroClr, hDC, nRow, nCol, nBmpWidth( hBitmap ), nBmpHeight( hBitmap ) )
SetBkColor( hDC, nOldClr )
return nil
yo posso utilizar PNG in CLASS TBitmap ?
ou yo necessito utilizar Image ?