Пример #1
0
        static int Main(string[] args)
        {
            if (args.Length != 3)
            {
                Console.WriteLine(@"Syntax error");
                return(-1);
            }

            var   programCore = new DoubleBitmap.DoubleBitmap();
            Image original, modified;

            try
            {
                original = new Bitmap(args[0]);
            }
            catch (System.IO.FileNotFoundException)
            {
                Console.WriteLine(@"Original file wasn't found");
                return(-1);
            }

            try
            {
                modified = new Bitmap(args[1]);
            }
            catch (System.IO.FileNotFoundException)
            {
                Console.WriteLine(@"Modified file wasn't found");
                return(-1);
            }

            try
            {
                programCore.LoadImages(original, modified);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                return(-2);
            }
            programCore.MetricName = args[2];
            programCore.SetCorners();
            Console.WriteLine(programCore.Metric().ToString());
            return(0);
        }
Пример #2
0
        static int Main(string[] args)
        {
            if (args.Length != 3)
            {
                Console.WriteLine(@"Syntax error");
                return -1;
            }

            var programCore = new DoubleBitmap.DoubleBitmap();
            Image original, modified;
            try
            {
                original = new Bitmap(args[0]);
            }
            catch (System.IO.FileNotFoundException)
            {
                Console.WriteLine(@"Original file wasn't found");
                return -1;
            }

            try
            {
                modified = new Bitmap(args[1]);
            }
            catch (System.IO.FileNotFoundException)
            {
                Console.WriteLine(@"Modified file wasn't found");
                return -1;
            }

            try
            {
                programCore.LoadImages(original, modified);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                return -2;
            }
            programCore.MetricName = args[2];
            programCore.SetCorners();
            Console.WriteLine(programCore.Metric().ToString());
            return 0;
        }
Пример #3
0
        private void Open()
        {
            sizeErrorLabel.Text = "";
            try
            {
                _programCore.LoadImages(leftImage.Image, rightImage.Image);
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.Message, @"Error");
                throw new Exception();
            }

            try
            {
                SetCorners();
            }
            catch (Exception exp)
            {
                sizeErrorLabel.Text = exp.Message;
                throw new Exception();
            }
        }