Пример #1
0
        protected void zoomAndPanControl_MouseWheel(object sender, MouseWheelEventArgs e)
        {
            e.Handled = true;
            Point curContentMousePoint = e.GetPosition(content);

            if (e.Delta > 0)
            {
                ZoomIn(curContentMousePoint);
            }
            else if (e.Delta < 0)
            {
                // don't allow zoomout les that original image
                if (ZoomAndPanControl.ContentScale - 0.1 > ZoomAndPanControl.FitScale())
                {
                    ZoomAndPanControl.ZoomOut(curContentMousePoint);
                }
                else
                {
                    ZoomAndPanControl.ScaleToFit();
                }
                ZoomOut(curContentMousePoint);
            }
            if (ZoomAndPanControl.ContentScale > ZoomAndPanControl.FitScale())
            {
                LoadFullRes();
                LayoutViewModel.FreeZoom = true;
            }
        }
Пример #2
0
        private void ZoomAndPanControl_ContentScaleChanged(object sender, EventArgs e)
        {
            GeneratePreview();
            var i = Math.Round(ZoomAndPanControl.FitScale(), 4);

            LayoutViewModel.FreeZoom = Math.Round(ZoomAndPanControl.ContentScale, 4) >
                                       Math.Round(ZoomAndPanControl.FitScale(), 4);
            if (!LayoutViewModel.FreeZoom)
            {
                LayoutViewModel.ZoomFit = true;
            }
        }
Пример #3
0
        private void ZoomAndPanControl_ContentScaleChanged(object sender, EventArgs e)
        {
            GeneratePreview();
            var i        = Math.Round(ZoomAndPanControl.FitScale(), 4);
            var freeZoom = Math.Round(ZoomAndPanControl.ContentScale, 4) >
                           Math.Round(ZoomAndPanControl.FitScale(), 4);

            if (!freeZoom)
            {
                LayoutViewModel.RefresZoomIndex(0);
            }
        }
Пример #4
0
 protected void zoomAndPanControl_MouseWheel(object sender, MouseWheelEventArgs e)
 {
     e.Handled = true;
     if (e.Delta > 0)
     {
         Point curContentMousePoint = e.GetPosition(content);
         ZoomIn(curContentMousePoint);
     }
     else if (e.Delta < 0)
     {
         Point curContentMousePoint = e.GetPosition(content);
         ZoomOut(curContentMousePoint);
     }
     if (ZoomAndPanControl.ContentScale > ZoomAndPanControl.FitScale())
     {
         LoadFullRes();
         LayoutViewModel.FreeZoom = true;
     }
 }
Пример #5
0
 private void ZoomAndPanControl_ContentScaleChanged(object sender, EventArgs e)
 {
     GeneratePreview();
     LayoutViewModel.FreeZoom = ZoomAndPanControl.ContentScale > ZoomAndPanControl.FitScale();
 }