其实就是判断打印纸的尺寸和你的图片尺寸,看要分几次打印,所谓切割,无非就是确定
从 Image1 向 Bitmap 拷贝的时候的起点和大小:
BitBlt(Bmp.Canvas.Handle,0,0,PaperWidth,PaperHeight,Image1.Picture.Bitmap.Canvas.Handle,0,0,SRCCOPY);
看看 BitBlt 的参数说明吧:
BOOL BitBlt(
HDC hdcDest, // handle to destination device context
int nXDest, // x-coordinate of destination rectangle's upper-left corner
int nYDest, // y-coordinate of destination rectangle's upper-left corner
int nWidth, // width of destination rectangle
int nHeight, // height of destination rectangle
HDC hdcSrc, // handle to source device context
int nXSrc, // x-coordinate of source rectangle's upper-left corner
int nYSrc, // y-coordinate of source rectangle's upper-left corner
DWORD dwRop // raster operation code
);
用一个循环就可以搞定,自己想一想啊,没必要写代码了吧。