Exemple #1
0
        public PuzzleForm(Image <Bgr, Byte> img)
        {
            InitializeComponent();
            pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
            Cursor = Cursors.WaitCursor;             // clock cursor

            rotatedImg  = img.Copy();
            originalImg = img.Copy();
            ImageClass.puzzleRotateOnly(rotatedImg, rotatedImg.Copy());


            finishedImg = ImageClass.puzzle(img, img.Copy(), out pieces, out pieces_angles, 3);

            paintBlack(rotatedImg, pieces);
            paintBlack(originalImg, pieces);
            Cursor = Cursors.Default;             // normal cursor

            for (int i = 0; i < pieces.Count; i++)
            {
                ListViewItem lvi = new ListViewItem(i.ToString());
                lvi.SubItems.Add(pieces_angles[i].ToString() + " Degrees");
                listView1.Items.Add(lvi);
            }
            listView1.Refresh();

            pictureBox1.Image = originalImg.Bitmap;
        }