Split image

Split image

Postby Marc Vanzegbroeck » Wed Dec 09, 2015 2: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
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: Split image

Postby ukoenig » Wed Dec 09, 2015 3: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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Split image

Postby Marc Vanzegbroeck » Wed Dec 09, 2015 4: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
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: Split image

Postby Antonio Linares » Wed Dec 09, 2015 6: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: Select all  Expand view  RUN
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
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Split image

Postby ukoenig » Wed Dec 09, 2015 9: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

Image

best regards
Uwe :D
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: karinha and 46 guests