Accessing TASImage protected zoom-related members

I use TASImage to open a grayscale image, read pixel information to a TArrayD* with GetArray passing 0 for the TImagePalette* argument, and then fill a 256 bin histogram with the array values to make a nice pixel value distribution of my image.

Now, what I would like to do next is zoom the image with a mouse drag (not the Zoom method), and retreive the protected fZoomOffX, fZoomOffY, fZoomWidth, and fZoomHeight UInt_t member objects so that I can use the CopyArea method on the original image to make a new image from which I can create a pixel value distribution as described above of strictly the zoomed area of the original image. Any thoughts?

The GetScaledImage method does not appear to return the image I speak of, as it has dimensions inconsistent with those of the protected members just listed.



Hi Jake,

Did you try to use GetScaledImage() ?


As mentioned in my post I have tried GetScaledImage, however, apparently I had not tried hard enough. After a more thorough analysis of GetScaledImage I find that the method does indeed do exactly what I want as I had originally hoped and expected.

What threw me was the following: After zooming in on an image, I dump the image to see that the fZoomWidth and fZoomHeight members have certain values. But when I ask for the width and height of the TImage returned by GetScaledImage, it returns different values! It wasn’t until my so-called thorough analysis that I realized that both sets of width and height values have the same ratio, and my image is intact.

So that solves my problem, but why do the fZoomWidth and fZoomHeight members not have the same values as the GetScaledImage returned TImage width and height values?

And thanks for the reply.