Esempio n. 1
0
        public MainWindow()
        {
            InitializeComponent();
            Fixtures = FixtureCollection.FromFile();

            if (Fixtures == null)
            {
                loadNeeded = true;
                discoverAll();
            }

            rotateLine = new Line();
            rotateLine.StrokeThickness = 1;
            rotateLine.Stroke          = Brushes.Red;
            MainCanvas.Children.Add(rotateLine);
            rotateLine.X1 = 0; rotateLine.X2 = 0;
            rotateLine.Y1 = rotateLine.Y2 = 0;
            Panel.SetZIndex(rotateLine, 3);
        }
Esempio n. 2
0
        private void discoverAll()
        {
            var files = System.IO.Directory.GetFiles("BaseImages");

            if (Fixtures == null)
            {
                Fixtures = new FixtureCollection();
            }

            foreach (var file in files)
            {
                var fix = Fixture.FromPNG(file);
                Fixtures.Add(fix);

                if (file == @"BaseImages\120mm.png")
                {
                    baseImage = fix.img;
                    Panel.SetZIndex(fix.img, 0);
                    MainCanvas.Width  = fix.img.Width;
                    MainCanvas.Height = fix.img.Height;
                    Bigwindow.Height  = fix.img.Height * 2 + 30;
                    //Bigwindow.ResizeMode = ResizeMode.NoResize;
                }
                else
                {
                    Panel.SetZIndex(fix.img, 1);
                }
                Canvas.SetLeft(fix.img, 0);
                Canvas.SetTop(fix.img, 0);
                // MainCanvas.Children.Add(fix.img);
            }

            Settings settings = new Settings();

            settings.Fixtures = this.Fixtures;
            settings.Show();
        }