Exemplo n.º 1
0
 private void ResetView()
 {
     _imgScale = 1;
     _offset   = new WindowsPoint(0, 0);
     if (_original != null)
     {
         ImgBase.Source = _original;
     }
     ImgBase.SetValue(Canvas.LeftProperty, _offset.X);
     ImgBase.SetValue(Canvas.TopProperty, _offset.Y);
 }
Exemplo n.º 2
0
        private void ResetView(ArtCardBarWrapper bar)
        {
            Rectangle rect = bar.GetRectangle();

            if (rect.Width != 0 && rect.Height != 0)
            {
                var calc = CalculateFromBar(rect);
                ScaleImage(calc.Item1);
                ImgBase.SetValue(Canvas.LeftProperty, calc.Item2);
                ImgBase.SetValue(Canvas.TopProperty, calc.Item3);
            }
            else
            {
                ResetView();
            }
        }