Пример #1
0
 public MainWindow()
 {
     _imgScale   = 1;
     _mapFile    = null;
     _barContext = new ArtCardBarWrapper();
     DataContext = _barContext;
     InitializeComponent();
 }
Пример #2
0
 public void UpdateBar()
 {
     if (CardArtDb.All.ContainsKey(CardId))
     {
         CardBar = new ArtCardBarWrapper(CardArtDb.All[CardId]);
     }
     else
     {
         CardBar = new ArtCardBarWrapper();
     }
 }
Пример #3
0
 private void LoadFile(FileObject file)
 {
     if (file != null)
     {
         StatusWrite(file.CardBar.CardId);
         StatusWrite(file.CardBar.TexturePath);
         ImgBase.Source = _original = file.Image;
         _barContext    = file.CardBar;
         DataContext    = _barContext;
         ResetView(_barContext);
         SetImageTitle();
     }
 }
Пример #4
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();
            }
        }