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 : Wednesday, August 8, 2007 12:10:35 PM(UTC)
steve.jackson

Groups: Registered
Posts: 7


I am setting the SizeMode property of the RasterViewer to 'fit' when I initially open my image. I would then like to have a button that will zoom the image in either direction by a percentage each time the button is pressed. What is happening is this. I am getting the current scale factor from the CurrentXScaleFactor property (I am doing this because the ScaleFactor property is always set to 1 when SizeMode is other than Normal). When I change my SizeMode to Normal, the CurrentXScaleFactor is changing to value that I am not sure where it comes from, but if I use it my first zoom delta is quite large. For instance if I am zooming out, my image goes from fitting the width of my viewer to a very small unreadable box in the center of my viewer.

How can I get the correct scale factor when using UseDpi paint property and SizeMode of 'Fit'?
I am using version 14.5 of the .NET api; Framework 2.0 and working in C#. The DPI of the image I am experimenting with is 400.


 

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 : Sunday, August 12, 2007 7:45:30 AM(UTC)

Amin  
Amin

Groups: Manager, Tech Support
Posts: 355


Steve,
When setting UseDpi to True, one inch in the image will correspond to one logical inch on screen. This means the actual display size will depend on both the image's DPI and the video display resolution. On most Widows systems, the video DPI will be at a default value of 96 DPI. So when displaying a 400-DPI image at 100% zoom level, one inch (or 400 image pixels) will be painted on 96 display pixels.

Amin Dodin

Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
#3 Posted : Thursday, August 16, 2007 3:50:35 AM(UTC)
steve.jackson

Groups: Registered
Posts: 7


Thank you Amin.

So I think to accomplish what I am after I need to take the scale factor and adjust it by the display dpi to image dpi ratio. I'll give it a try.
 
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.109 seconds.