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);