I have an Image create wih FW_DrawImage()
How I can save and print this image ?
Otto wrote:Silvio,
Would you mind posting how?
Best regards,
Otto
//---------------------------------------------------------------------------//
// copied from fwh32\source\winapi\wndprint.c
HB_FUNC( WNDBITMAPRECT ) // hWnd, aRect --> hBitmap
{
HWND hWnd = ( HWND ) fw_parH( 1 );
HDC hDC = GetWindowDC( hWnd );
HDC hMem = CreateCompatibleDC( hDC );
RECT srcRect;
RECT rct;
HBITMAP hBmp, hOldBmp;
srcRect.top = hb_parvni( 2, 1 );
srcRect.left = hb_parvni( 2, 2 );
srcRect.bottom = hb_parvni( 2, 3 );
srcRect.right = hb_parvni( 2, 4 );
//GetWindowRect( hWnd, &rct );
rct.left = 0;
rct.top = 0;
rct.right = srcRect.right - srcRect.left;
rct.bottom = srcRect.bottom - srcRect.top;
hBmp = CreateCompatibleBitmap( hDC, rct.right, rct.bottom);
hOldBmp = ( HBITMAP ) SelectObject( hMem, hBmp );
BitBlt( hMem, 0, 0, rct.right, rct.bottom , hDC, srcRect.left, srcRect.top, SRCCOPY );
SelectObject( hMem, hOldBmp );
DeleteDC( hMem );
ReleaseDC( hWnd, hDC );
fw_retnll( hBmp );
}
//----------------------------------------------------------------------------//
MakeBkBmpEx( hWnd, top, left, width, height )
oWnd:SaveAsImage( anyimagefile, [ { top, left, bottom, right } ] )
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 94 guests