Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, November 29, 2011 4:36:12 AM(UTC)
johnreichert

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


File Attachment(s):
printImage.zip (693kb) downloaded 25 time(s).
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Thursday, December 1, 2011 7:10:32 AM(UTC)

Daoud  
Daoud

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)
johnreichert

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)

Daoud  
Daoud

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.

 
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.

Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.063 seconds.