Zooming Object Graphics [message #35331] |
Wed, 11 June 2003 06:02 |
darrick.white
Messages: 7 Registered: January 2003
|
Junior Member |
|
|
I'm trying to zoom a 2-D image without data transformation. I'm
currently using the viewplane property of IDLgrView. This is the
simplest way for me to achieve my zooming feature of my application
without using normalized data. My viewplane algorithm is as follows,
taking into consideration the current position of the cursor:
; Zoom window according to size of view port, not size of image
view[0] = view[0] + ROUND((!CONFIG.ZoomScale) * (
FLOAT((*pInfo).xCoord) / dim[0] ))
view[1] = view[1] + ROUND((!CONFIG.ZoomScale) * (
FLOAT((*pInfo).yCoord) / dim[1] ))
view[2] = (view[2] - !CONFIG.ZoomScale) > 1
view[3] = (view[3] - !CONFIG.ZoomScale) > 1
This works great on an image with the same x/y dimensions. All pixels
look symmetrical, as expected. As soon as the image dimensions change
(open a different image. ie. 1900x2250), zooming the image makes the
pixels look asymmetrical, as expected. Any ideas on how to make any
size image seem symmetrical when using the zoom feature?
The examples I've seen, such as David's contrastzoom, use normalized
data and changing image dimensions. I'm hoping to stay away from this
and keep my natural data coordinates.
Thanks
-Darrick
|
|
|