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, July 11, 2006 9:53:52 AM(UTC)

mwyrick  
mwyrick

Groups: Registered
Posts: 4


I have a RasterImageViewer object called viewer.  It has an Image set and I let the user do an Interactive zoom.  I then need to change the image but the new image will have the same size etc.  My question is how do I get the zoom/pan settings for the current view and Restore them after viewer.image is changed so the new image will show the same area that the old one showed.

CurrentXScaleFactor is ReadOnly. 

 I can't seem to find a way to read the current settings in a way that ZoomToRectangle would like.

- Michael

 

 

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 : Friday, July 14, 2006 4:20:57 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 766


Michael,

If you want to set a zoom factor based on a percentage, use the PaintZoomFactor.  You have to first set the PaintSizeMode to PAINTSIZEMODE_ZOOM, and then you can use the zoom factor.  A value of 100 would be equivalent to 100%, 50 would be 50% and would shrink the image in half.  200 = 200% and would make the image look twice as large.  You could set this before loading another image to make sure it will load and display at the correct zoom factor.  The code sample below sets the zoom factor to 100% in VB 6.0.

LEADRasterView1.PaintSizeMode= PAINTSIZEMODE_ZOOM
LEADRasterView1.PaintZoomFactor = 100
 
#3 Posted : Friday, July 14, 2006 6:51:45 AM(UTC)

mwyrick  
mwyrick

Groups: Registered
Posts: 4


I am tring to get from the current zoom/pan settings from the view and then restore them after the image is changed.  Just setting the zoomfactor does not return the new image to the same display as before the image object was changed.

If the CurrentXScaleFactor and CurrentYScaleFactor could be written, or if I could save and restore the PhysicalViewRectangle I could do what I want.  But I have not been able to find a way to read and then write the current view.

- Michael

 
#4 Posted : Friday, July 14, 2006 1:00:03 PM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 766


Michael,

I'm sorry for not understanding what you wanted earlier.  I thought you were wanting to restore the zoom to the same position every time an image was loaded.  Now I think I understand, you want to keep your "eye" exactly where it is when you load a new image.  To do this, you need to set these two properties to FALSE:

RasterImageViewer.AutoResetScaleFactor
RasterImageViewer.AutoResetScrollPosition

This will keep your "eye" where it is.  However, keep in mind that if your images are different sizes, you might not get same results.

Hopefully I have understood you correctly this time, sorry for making this harder than it should have been if this is all you needed =).
 
#5 Posted : Wednesday, August 2, 2006 6:02:52 AM(UTC)

mwyrick  
mwyrick

Groups: Registered
Posts: 4


Thank you for that info.  That does work the way i would like.  It would be nice to have a way to save the current "eye" as you called it, (scale and scroll position) to a file that I can recall later.  Is there a way to read and write those values?

 

 

 
#6 Posted : Thursday, August 3, 2006 11:33:28 AM(UTC)

Otis  
Guest

Groups: Guests
Posts: 3,034

Was thanked: 1 time(s) in 1 post(s)

We do not have any functions for loading and saving these values to file, but we do provide you with the values so that you can save/load them yourself.

HScrollInfo property (ILEADRasterView) - horizontal scroll bar position

VScrollInfo property (ILEADRasterView) - vertical scroll bar position

PaintZoomFactor property (ILEADRasterView) - zoom factor

 
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.227 seconds.