Getting zoomed area in TASImage

In fact I am using astroroot, but I think this refers directly to TASImage.

How do I get information, what area was selected and zoomed with a mouse?

Desperately, I’ve tried:

cout << "zooomed: " << ((TASImage*)disp[i]->GetScaledImage())->GetScaledWidth() << " " << ((TASImage*)disp[i]->GetScaledImage())->GetScaledHeight() << endl;
cout << "zooomed: " << ((TASImage*)disp[i]->GetScaledImage())->GetWidth() << " " << ((TASImage*)disp[i]->GetScaledImage())->GetHeight() << endl;
cout << "zooomed: " << disp[i]->GetWidth() << " " << disp[i]->GetHeight() << endl;
cout << "zooomed: " << disp[i]->GetScaledWidth() << " "  << disp[i]->GetScaledHeight() << endl;

where disp[i] is of AstroImage class which derives from TASImage.

In each case, same result is displayed - width and height in screen coordinates, not in original image coordinates, where, as I understand, GetHeight and GetWidth() should return results in image coordinates.

Also, how can I get position of a corner fo zoomed image?

Yes I agree with you GetScaledWidth and GetScaledHeight do not seem to work correctly.
I will check.

I have implemented a new method to retrieve the zoom position in TASInage. It is:

  void TASImage::GetZoomPosition(UInt_t &x, UInt_t &y, UInt_t &w, UInt_t &h) const

Example:

root [0] TASImage *img = TASImage::Open("rose512.jpg");
root [1] img->Draw();
root [2] UInt_t x,y,w,h;
... here I did a zoom using the mouse
root [3] img->GetZoomPosition(x,y,w,h);
root [4] printf("%d %d %d %d\n",x,y,w,h);
97 132 186 124
... here I did a zoom using the mouse
root [5] img->GetZoomPosition(x,y,w,h);  
root [6] printf("%d %d %d %d\n",x,y,w,h);
179 174 35 28
root [7] img->UnZoom()
root [8] img->GetZoomPosition(x,y,w,h); 
root [9] printf("%d %d %d %d\n",x,y,w,h);
0 0 512 384

Great! Thanks!

I understand, that this change is available through CVS?

In SVN yes:
root.cern.ch/viewvc/trunk/graf2d/asimage/