FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Split image
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Split image
Posted: Wed Dec 09, 2015 02:22 PM

Hello,

How can I split an image in smaller images?
I have to print a big bmp/jpg-file, but the size is bigger than the paper.
I want to split the image, so I can print each part on a separate paper, with a nice title.

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Split image
Posted: Wed Dec 09, 2015 03:01 PM

Marc,

are You looking for a BUILDIN-solution
or a solution, just a way to do it ?

Using PIXELFORMER, I can show You a step by step solution.

best regards
Uwe :?:

Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: Split image
Posted: Wed Dec 09, 2015 04:22 PM

Uwe,

I'am looking for a build-in solution.
Bij program generate some drawings, and print them.
If they are to big, I have to spit it before printing.

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Split image
Posted: Wed Dec 09, 2015 06:48 PM
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 (fw): Select all Collapse
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;
}
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Split image
Posted: Wed Dec 09, 2015 09:04 PM
Antonio, Marc

some month ago I created a tool with a visual selection.
It could be extended using a dialog with scrollbars using the original imagesize.
2. selecting a area for a transparent get to include a text for the new image with a selected color.
This solution uses < NCONVERT >
Antonio, as well I can have a look at Your solution.

A new image from a selected area



best regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.

Continue the discussion