#define SRCCOPY 0x00CC0020
DLL32 FUNCTION CreateCompatibleBitmap( hDC AS LONG, nWidth AS LONG, nHeight AS LONG ) AS LONG ;
PASCAL FROM "CreateCompatibleBitmap" LIB "gdi32.dll"
DATA cBmpAdjBrush // BMP file/resource
DATA lBrushed AS LOGICAL INIT .F. // used internally for check brush
local hBmpDC, hDCComp, hOldBitMap, hBmp, hBmpNew
if ::cBmpAdjBrush != NIL .and. !::lBrushed
::lBrushed := .t.
::lTransparent := .t.
if valtype( ::cBmpAdjBrush ) == "C"
if '.' $ ::cBmpAdjBrush
if upper( right( ::cBmpAdjBrush, 3 ) ) == "BMP"
if file( ::cBmpAdjBrush )
hBmp := ReadBitmap( 0, ::cBmpAdjBrush )
else
msgstop( "File " + ::cBmpAdjBrush + " not Found","Fivewin: Class TXBrowse" )
return( 0 )
endif
else
msgstop( "Bad BMP File format","Fivewin: Class TXBrowse" )
return( 0 )
endif
else
if ( hBmp := LoadBitmap( GetResources(), ::cBmpAdjBrush ) ) == 0
msgstop( "Resource " + ::cBmpAdjBrush + " No Found", "Fivewin: Class TXBrowse" )
return( 0 )
endif
endif
else
msgstop( "Only BMP File or Resource","Fivewin: Class TXBrowse" )
return( 0 )
endif
PalBmpDraw( ::hDC, 0, 0, hBmp,, (::nRight - ::nLeft), ( ::nBottom - ::nTop ) )
::lBrushed := .t.
hDCComp := CreateCDC( ::hDC )
hBmpNew := CreateCompatibleBitMap( ::hDC, ::oWnd:nWidth, ::oWnd:nHeight )
holdBitMap := selectobject( hdccomp, hBmpNew )
BitBlt( hDCComp, 0, 0, ::oWnd:nWidth, ::oWnd:nHeight, ::hDC, 0, 0, SRCCOPY )
selectobject( hBmpNew, hOldBitMap )
::lTransparent := .t.
::Refresh()
::oBrush:hBrush:=CreatePatternBrush( hBmpNew )
DeleteObject( hBmp )
endif
PalBmpDraw(::hDC,::HeaderHeight(),RECORDSELECTOR_WIDTH, hBmp,, ;
::BrwWidth()- RECORDSELECTOR_WIDTH,::BrwHeight() -::FooterHeight() )
::lBrushed := .t.
hDCComp := CreateCDC(::hDC )
hBmpNew := CreateCompatibleBitMap(::hDC,::BrwWidth(),::BrwHeight()-::FooterHeight())
holdBitMap := selectobject(hdccomp,hBmpNew)
BitBlt( hDCComp,::HeaderHeight(),RECORDSELECTOR_WIDTH,::BrwWidth(), ;
::BrwHeight(),::hDC,::HeaderHeight(),RECORDSELECTOR_WIDTH, SRCCOPY )
PalBmpDraw(::hDC,::HeaderHeight(),RECORDSELECTOR_WIDTH, hBmp,, ;
::BrwWidth()- RECORDSELECTOR_WIDTH,::BrwHeight() -::FooterHeight() )
::lBrushed := .t.
hDCComp := CreateCDC(::hDC )
hBmpNew := CreateCompatibleBitMap(::hDC,::BrwWidth(),::BrwHeight()-::FooterHeight())
holdBitMap := selectobject(hdccomp,hBmpNew)
BitBlt( hDCComp,::HeaderHeight(),RECORDSELECTOR_WIDTH,::BrwWidth(), ;
::BrwHeight(),::hDC,::HeaderHeight(),RECORDSELECTOR_WIDTH, SRCCOPY )
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 97 guests