Developing a Silverlight DeepZoom app, I needed to reimplement MultiScaleImage.ZoomAboutLogicalPoint method in terms of changing ViewportWidth and ViewportOrigin, and this is what code I’ve ended with: public void ZoomAboutPoint(double newScale, Point scalePoint) { double newViewportWidth = _currentViewportWidth / newScale; Point centerPoint = new Point(scalePoint.X / this.ActualWidth, scalePoint.Y / this.ActualHeight); double aboutLogicalPointFactor = _currentViewportWidth – newViewportWidth; Point newViewportOrigin = …
Continue reading “The math behind MultiScaleImage.ZoomAboutLogicalPoint”