Marc,
You could modify the source code of FWH function DuplicateBitmap() in fwh\source\winapi\bmpdraw.c
and use it to split your bitmap into several ones:
Change this line parameters to specify the origin and the dimensions:
BitBlt( hdcDest, 0, 0, bmp.bmWidth, bmp.bmHeight, hdcSrc, 0, 0, SRCCOPY);
- Code: Select all Expand view
HBITMAP DuplicateBitmap( HBITMAP hbmpSrc )
{
HBITMAP hbmpOldSrc, hbmpOldDest, hbmpNew;
HDC hdcSrc, hdcDest;
BITMAP bmp;
hdcSrc = CreateCompatibleDC( NULL );
hdcDest = CreateCompatibleDC( hdcSrc );
GetObject( hbmpSrc, sizeof( BITMAP ), &bmp );
hbmpOldSrc = ( HBITMAP ) SelectObject( hdcSrc, hbmpSrc );
hbmpNew = CreateCompatibleBitmap( hdcSrc, bmp.bmWidth,
bmp.bmHeight );
hbmpOldDest = ( HBITMAP ) SelectObject( hdcDest, hbmpNew );
BitBlt( hdcDest, 0, 0, bmp.bmWidth, bmp.bmHeight, hdcSrc, 0, 0,
SRCCOPY);
SelectObject( hdcDest, hbmpOldDest );
SelectObject( hdcSrc, hbmpOldSrc );
DeleteDC( hdcDest );
DeleteDC( hdcSrc );
return hbmpNew;
}