LEADTOOLS Support
General
General Questions
Get the Height of an Image loaded into the TLeadImage component
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Thursday, August 12, 2010 9:29:13 PM(UTC)
Groups: Registered
Posts: 5
I´m using LeadTools vector Imaging pro 14.5. I use the TLeadImage component in Delphi 2006. I load images of different formats, .png, .jpg and .cal images into the TLeadImage. I want LeadTools to tell me the height of each image in millimeters or centimeters. How can I get that information?
Best Regards/
Helena
#2
Posted
:
Sunday, August 15, 2010 1:34:44 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
You can calculate the physical height of the image using this equation:
Size in inches = Lead1.BitmapHeight (in pixels or dots) / Lead1.BitmapYres (the Vertical resolution or DPI)
You can then convert the size in inches to centimeters by this ratio:
1 inch = 2.54 centimeters
The same can apply to the width using the Lead1.BitmapWidth and Lead1.BitmapXres properties.
#3
Posted
:
Monday, August 16, 2010 1:34:09 AM(UTC)
Groups: Registered
Posts: 5
Thanks for your answer. I use the equation but the result in centimeters isn´t the right I think. When I insert the same image into word and view the size property of the image it says that the image is 3,5 cm higher than the result from TLeadimage properties. How come ?? Best regards/ Helena
#4
Posted
:
Monday, August 16, 2010 3:21:45 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
I want to check the file at my side. Can you attach the sample image in a ZIP or RAR file to ensure it is delivered correctly?
You can either post it here or send it to
support@leadtools.com and mention this post.
When attaching to the forums, do not use the "Preview" feature.
#5
Posted
:
Wednesday, September 1, 2010 5:09:29 AM(UTC)
Groups: Registered
Posts: 5
Hello!
Sorry for my late reply but I have been on vacation. Here is the picture. Best regards/ Helena
#6
Posted
:
Thursday, September 2, 2010 3:05:50 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
The image you sent does not have a resolution value saved with it so our toolkit loads it with the default value of 150.
If the file has no DPI value, you should set the source DPI value after you load the image using the BitmapXRes and BitmapYRes properties.
There isn't a way to check if the file has a DPI value or not, but I want to investigate this issue further. Please send your LEADTOOLS v14.5 serial number to
support@leadtools.com and include a link to this forum post. Please do not post your serial number here.
LEADTOOLS Support
General
General Questions
Get the Height of an Image loaded into the TLeadImage component
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.