I am having some problem and hope that someone can answer the question. I have a deep zoom project that I Standard (Deep Zoom Composer) Control Image Maltiskel which used project I drew from the screen to the screen that I am trying to disrupt dragging to make it (and therefore Unable to locate image). I added a Home button that will bring the image back to the initial position on the zoom of 1. However, the code here is here (to turn the internet in search of an answer).
// MSI multiscale image msi.MouseLeftButtonDown + = Representative (Object Sender, MouseButtonEventArgs e) {lastMouseDownPos = E. GetPosition (MSI); // class level var lastMouseViewPort = msi.ViewportOrigin; // class level var mousedown = true; // class level var msi.CaptureMouse (); }; Msi.MouseMove + = Representative (Object Sender, MouseEventArgs e) {lastMousePos = E. GetPosition (MSI); If (during drag) {point newpoint = final musicport; NewPoint.X + = (LastMobileDownPix.x - LastMobosPos.x) / MSI Real objects * MSI. Viewportwidth; NewPoint.Y + = (Last Mobile Deposit.Y - Last Music P.Y) / MSI. RealWed * MSI. Viewported; Var range = new racket (new point (1, 1 / msi espectraatio), new point (-1, -1 / msi.experktatio)); If (newPoint.X> limitations. Right * .999) {newPoint.X + = (-2 * (last mobile version.x - FinalMobus POS.x)) / MSI. RealWide * MSI vivoWedth; // is time to change direction to the left} if (newPoint.Y & gt; Simaankbotm * .999) {newPoint.Y + = (-2 * (Antimmobausdaunpoj. Y - Final Message.) / MSI. ViewportWidth ; // changes direction to close above the screen} msi.ViewportOrigin = lastMouseViewPort = newPoint; Piclamohndaunpos = Antimmobaspos;}};
I really need a solution that is right and Works for the bottom, but at the same time I change all the values. My limit code works if zoom level There is no 1. I can not believe that it is nowhere on the Internet! But when zoom changes, everything goes out of the window (the values for the new point are not in the limits of my expectation).
And as soon as I understood it myself (eventually several weeks later) .
Here is the answer (Simple change is the mouse movement example):
msi.MouseMove + = delegate (Object sender, MouseEventArgs e) {lastMousePos = e GetPosition (MSI); If (during drag) {point newpoint = final musicport; NewPoint.X + = (LastMobileDownPix.x - LastMobosPos.x) / MSI Real objects * MSI. Viewportwidth; NewPoint.Y + = (Last Mobile Deposit.Y - Last Music P.Y) / MSI. RealWed * MSI. Viewported; Var range = new rack (new point (1, 1 / msi, approximate), new point (-1 / zoom level, -1 / msi convulsions / settings .zoom level)); If (newPoint.X and lt; limits.Left * .999) {newPoint.X + = (-2 * (LastMobid Download PX.X - Last Message). / MSI // If we run right then reverse x direction} (Nupoint.aks & gt; limitations. right * .999) {newPoint.X + = (-2 * (final mobile Dipart Pios.aks - Antimmobas Pios.aks)) / Msaikvakyual wide * msi.ViewportWidth; // If we leave then the reverse x direction} if (newPoint.Y & lt; limits.Top * .999) {newPoint.Y + = (-2 * (LastMobileDownPos.Y - LastPospose.Y)) / MSI. RealWed * MSI. View portWidth; // we shut down the reverse direction} if (newPoint.Y & gt; limits.Bottom * .999) {newPoint.Y + = (-2 * (Antimmobausdaunpoj. Wi - Antimmois drink. Y)) / MSI. real wide * MSI .ViewportWidth; // we top then moved opposite direction} msi.ViewportOrigin = lastMouseViewPort = newPoint; Piclamohndaunpos = Antimmobaspos; Msi.SendMovedZoomMsg (Settings.ZoomLevel, newPoint, myClassName);}};
< / Pre>This probably does not constitute a complete image, but it keeps it on the screen and the user may go in the wrong direction. Shish to make off
Comments
Post a Comment