コード例 #1
0
ファイル: DetektorForm.cs プロジェクト: Dragoris96/WFA
 private void RightFlipButton_Click(object sender, EventArgs e)
 {
     image.RotateFlip(RotateFlipType.Rotate90FlipNone);
     Defaultpicture.Image    = image;
     Defaultpicture.SizeMode = PictureBoxSizeMode.Zoom;
     Defaultpicture.Invalidate();
 }
コード例 #2
0
ファイル: DetektorForm.cs プロジェクト: Dragoris96/WFA
 private void RightFileButton_Click(object sender, EventArgs e)
 {
     if (count < cont)
     {
         count++;
         image = new Bitmap(full_name_of_img[count - 1]);
         Defaultpicture.Image    = image;
         Defaultpicture.SizeMode = PictureBoxSizeMode.Zoom;
         Defaultpicture.Invalidate();
     }
     label1.Text = Convert.ToString(count) + "/" + Convert.ToString(cont);
 }
コード例 #3
0
ファイル: DetektorForm.cs プロジェクト: Dragoris96/WFA
        private void openfilebutton_Click(object sender, EventArgs e)
        {
            OpenFileDialog open_dialog = new OpenFileDialog();

            open_dialog.Filter = "Image Files(*.BMP;*.JPG;*.GIF;*.PNG)|*.BMP;*.JPG;*.GIF;*.PNG|All files (*.*)|*.*";
            if (open_dialog.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    full_name_of_img[count] = open_dialog.FileName;
                    count++;
                    cont++;
                    image = new Bitmap(full_name_of_img[count - 1]);
                    Defaultpicture.Image    = image;
                    Defaultpicture.SizeMode = PictureBoxSizeMode.Zoom;
                    Defaultpicture.Invalidate();
                    LeftFlipButton.Visible  = true;
                    RightFlipButton.Visible = true;
                    //получение матрицы с пикселями
                    pixel = new UInt32[image.Height, image.Width];
                    for (int y = 0; y < image.Height; y++)
                    {
                        for (int x = 0; x < image.Width; x++)
                        {
                            pixel[y, x] = (UInt32)(image.GetPixel(x, y).ToArgb());
                        }
                    }

                    label1.Text = Convert.ToString(count) + "/" + Convert.ToString(cont);
                }
                catch
                {
                    full_name_of_image = "\0";
                    DialogResult rezult = MessageBox.Show("Невозможно открыть выбранный файл",
                                                          "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }