Пример #1
0
        public Form1()
        {
            InitializeComponent();

            string dirPath = Directory.GetParent(Environment.CurrentDirectory).Parent.FullName
                + "\\Images\\";

            openImageDialog.InitialDirectory = Environment.CurrentDirectory;

            OriginalBoardImage = dirPath + OriginalBoardImage;

            for (int idx = 0; idx < DifBoardImages.Count; idx++)
                DifBoardImages[idx] = dirPath + DifBoardImages[idx];

            GrigoreImage = dirPath + GrigoreImage;
            Grigore = new Robot(new Size(640, 400));
            //Grigore.Position = new System.Drawing.Point(0, 0);
            //Grigore.TurnLeft(-Grigore.Direction);
            try { Grigore.Image = (Bitmap)Bitmap.FromFile(GrigoreImage); }
            catch { }

            UpdateUI();

            GeneratedImage();
        }
Пример #2
0
        public void Run()
        {
            dirPath = Environment.CurrentDirectory + "/Images/";
            if (!Directory.Exists(dirPath))
                dirPath = Directory.GetParent(Environment.CurrentDirectory).Parent.FullName + "/Images/";

            OriginalBoardImage = dirPath + OriginalBoardImage;

            for (int idx = 0; idx < DifBoardImages.Count; idx++)
                DifBoardImages[idx] = dirPath + DifBoardImages[idx];

            GrigoreImage = dirPath + GrigoreImage;
            Grigore = new Robot(new Size(640, 400));

            //// set it to origin, unrotated
            //Grigore.Position = new System.Drawing.Point(0, 0);
            //Grigore.TurnLeft(-Grigore.Direction);
            try { Grigore.Image = (Bitmap)Bitmap.FromFile(GrigoreImage); }
            catch { }

            GeneratedImage();

            ParseImage(-1);
        }