示例#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();
            }
        }