Maintaining Square Pixels on Zooming Image
hegedus
Does anyone have code that would maintain square pixels when zooming an image. I am working on a project where the the aspect ratio of a particle is an important feature. I do not want to have confusion by a zoom that sets the scales differently in X and Y.
I am looking to see if this problem has been solved before. Any code to share?
Andy
do you know the height and width options of ModifyGraph?
June 20, 2017 at 10:24 am - Permalink
It is my understanding that those features control the aspect ratio of the window when the window is resized by dragging an edge and I am more focused on the axis range within.
For example, the current image is 1024x1024 and I can constrain that to 1:1 aspect ratio. The issue arises in that the feature of interest is much smaller and the natural action is to use the marque tool and expand. However, if care and precision are not exercised then the marque window will not be square and the resulting expand will leave rectangular pixels that could lead to a false interpolation of the data if the user is unaware. Most picture based programs constrain the zoom to keep square pixels. The largest range of the marquee is used to set the range for both axis at least for a square image.
I would like to recreate this constraint for expanding. Ideally I would like the more general case where the pixels are square even for non-square images. I am envisioning some sort of window hook function and was interested if someone has already solved this problem.
Andy
June 20, 2017 at 12:33 pm - Permalink
June 20, 2017 at 12:45 pm - Permalink
Love learning something new.
Andy
June 20, 2017 at 02:05 pm - Permalink