Calculating DocScale

Hi,

i need to zoom in a given view’s rectangle (in WebForm) like I gess the DoRubberBand does.
I’have the good rectangle but my function which calculates the DocScale seems not to be that good.

I also need to limit the DocScale so that the user can’t zoom in more than the javascript goZoomF(‘fit’,‘MyView’) function does.

Can anybody help ?
Thanks in advance.
Stephane

Here is my code for the ‘zoom in rectangle’ function :

RectangleF zoomedRect =  MyView.ConvertViewToDoc(new

Rectangle(Int32.Parse(rectValue s[0]),Int32.Parse(rectValues[1]),Int32.Parse(rectValues[2]),Int32.Parse(rectValues[3])));
RectangleF actualRect;
if (MyView.DocScale > 1)
actualRect = MyView.DocExtent;
else

    actualRect =

MyView.DisplayRectangle;

float fWidthScale =

actualRect.Width/Single.Parse(rectValues[2]);

float fHeigtScale =

actualRect.Height/Single.Parse(rectValues[3]);

MyView.DocScale *= Math.Min(fWidthScale,fHeigtScale);
            MyView.ScrollRectangleToVisible(zoomedRect);

GoToolZooming should work. Like other tools with WebForms, there isn’t any continuous feedback such as the rubberband box, but the end functionality ought to still work.
But if you really want to reimplement that tool with your own customizations, send me e-mail and I’ll send you the code for GoToolZooming.

I’m interested by the code for GoToolZooming.
I’m also interested by the RescaleToFit method, to find my LimitDocScale.
Thanks a lot.
stephane.papelier@tdf.fr