Example #1
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog op = new OpenFileDialog();

            op.Title  = "Select a picture";
            op.Filter = "All supported graphics|*.jpg;*.jpeg;*.png*|" +
                        "JPEG (*.jpg;*.jpeg)|*.jpg;*.jpeg|" +
                        "Portable Network Graphic (*.png)|*.png";
            if (op.ShowDialog() == true)
            {
                BitmapImage mapimg;
                Bitmap      img;
                mapimg          = new BitmapImage(new Uri(op.FileName));
                imgPhoto.Source = mapimg;
                img             = new Bitmap(op.FileName);
                ImgProcessor gon = new ImgProcessor(img);
                gon.calcCross();
                textBoxX.Text = $"Cмещение X {gon.X.ToString()}";
                textBoxY.Text = $"Смещение Y {gon.Y.ToString()}";
            }
        }
Example #2
0
 public MainWindow()
 {
     InitializeComponent();
     processor = new ImgProcessor();
 }