LEADTOOLS Support
Document
Document SDK Questions
Printed copy scales differently for two different images of the same size
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Tuesday, November 29, 2011 4:36:12 AM(UTC)
Groups: Registered
Posts: 47
Hi -
I have two sample images: caption1.jpeg and caption2.jpeg. They are both 1024 x 1243 pixels. I print both the images using the attached sample project - caption1.jpeg does not fill up the page, but caption2.jpeg does fill most of the page. My customers (and my) preference is that the printout scales the image to fill as much of the page as possible - as the caption2.jpeg image does.
Can you explain why these images scale differently when printed? I have tried this on three different printers in my office and get the same result on all three printers.
To replicate this issue:
1. Run the attached project in the VS debugging mode.
2. Click the caption1.jpeg button - the caption1 image prints
3. Click the caption2.jpeg button - the caption2 image prints
Our version of Leadtools is as follows:
Leadtools.dll 17.0.0.19
Leadtools.codecs.dll 17.0.0.22
Leadtools.codecs.cmp.dll 17.0.0.8
Leadtools.drawing.dll 17.0.0.3
Leadtools.winforms.dll 17.0.0.8
#2
Posted
:
Thursday, December 1, 2011 7:10:32 AM(UTC)
Groups: Registered
Posts: 256
The 2 images have the exact same number of pixels (dots), but their physical size is not the same.
The main difference between the 2 images is that one of them has a resolution of 150 dots per inch (DPI) while the other is only 96 DPI.
The width in inches equal to (Width in pixels)/(DPI).
Also, height in inches equal to (height in pixels)/(DPI).
This means one image is 6.8x8.3 inches, while the other is 10.7x12.9 inches.
If you want both images to have the same size, simply change the values of RasterImage.XResolution and RasterImage.YResolution of one image to match the other before you print them. This should work because both have the same number of pixels.
#3
Posted
:
Thursday, December 1, 2011 8:20:06 AM(UTC)
Groups: Registered
Posts: 47
I think I understand now - does setting the "UseDpi" property to False of RasterImagePrinter cause LEAD to ignore any DPI settings in the image? That seemed to do the trick for me in this case - both the images fill the same area on the printed page now.
Thanks for pointing me in the right direction.
John
#4
Posted
:
Sunday, December 4, 2011 5:40:02 AM(UTC)
Groups: Registered
Posts: 256
John,
Setting UseDpi to False will cause all scaling values to be relative to pixels and not to inches.
This means a zoom factor or 100% will cause every pixel in the image to be rendered as exactly one pixel (or dot) when displayed.
For more information read our help topic for the UseDpi property in our .NET help file.
LEADTOOLS Support
Document
Document SDK Questions
Printed copy scales differently for two different images of the same size
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.