I'm using ImageEn version 12.5.0.
I want to be able to print the same image several times on a single A4 page with a 600ppi printer.
Here's the example code for printing 3*6 images (this fits on an A4 page with my test image):
...
ImageEnIO->LoadFromFile(pathFile); //load image 4128x2322 px
if (!PrinterSetupDialog->Execute()) //select printer
return;
//retrieve page dimension information
TPrinter* printer = Printer();
int widthPx = GetDeviceCaps(printer->Handle, HORZRES);
int heightPx = GetDeviceCaps(printer->Handle, VERTRES);
int DensiteLspx = GetDeviceCaps(printer->Handle, LOGPIXELSX);
int DensiteLspy = GetDeviceCaps(printer->Handle, LOGPIXELSY);
//reading basic image dimensions
int widthPxImg = ImageEnIO->IEBitmap->Width;
int heightPxImg = ImageEnIO->IEBitmap->Height;
int nb_img_width = 3; //number of images per line
int nb_img_height = 6; //number of lines, with 4 this work
//take the image size required for printing
int widthMinImg = widthPx / nb_img_width;
int heightMinImg = heightPxImg * widthMinImg / widthPxImg;
ImageEnIO->IEBitmap->Resample(widthMinImg, heightMinImg); //image resized to print size
//global image creation
TImageEnIO * imgGlobal = new TImageEnIO(this);
imgGlobal->IEBitmap->PixelFormat = ie24RGB;
imgGlobal->IEBitmap->Resize(widthMinImg*nb_img_width, heightMinImg*nb_img_height);
int PosXPx = 0;
int PosYPx = 0;
for(int i = 0; i < nb_img_height; i++){
PosYPx = i * heightMinImg;
for(int j = 0; j < nb_img_width; j++){
PosXPx = j*widthMinImg;
ImageEnIO->IEBitmap->DrawToTIEBitmap(imgGlobal->IEBitmap, PosXPx, PosYPx);
}
}
/*float widthInch = ((float)imgGlobal->IEBitmap->Width*1.0) / ((float)DensiteLspx*1.0);
float heightInch = ((float)imgGlobal->IEBitmap->Height*1.0) / ((float)DensiteLspy*1.0);
imgGlobal->PrintImagePos(0,0, widthInch, heightInch); */
//we define the image resolution
imgGlobal->IEBitmap->ParamsEnabled = true;
imgGlobal->IEBitmap->Params->DpiX = DensiteLspx;
imgGlobal->IEBitmap->Params->DpiY = DensiteLspy;
//print
imgGlobal->PrintImage(0, ievpTop, iehpLeft, iesNormal);
delete imgGlobal;
...
But the printer only prints a message :
PDF Error 11: PostScript Error: LIMITCHECK .
But with 3*4 images it works. They print fine.
Do you know why?
Is there a solution to make this work?