Exemplo n.º 1
0
        private void bilinearToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (img == null) // verify if the image is already opened
            {
                return;
            }
            Cursor = Cursors.WaitCursor; // clock cursor

            //copy Undo Image
            imgUndo = img.Copy();

            InputBox rot = new InputBox("Rotation Angle", numberTextBox);

            rot.ShowDialog();
            if (rot.DialogResult == DialogResult.OK)
            {
                int   ang = Convert.ToInt32(rot.ValueTextBox.Text);
                float rad = Convert.ToSingle(Math.PI / 180.0 * ang);

                ImageClass.Rotation_Bilinear(img, img.Copy(), rad);

                ImageViewer.Image = img.Bitmap;
                ImageViewer.Refresh(); // refresh image on the screen
            }

            Cursor = Cursors.Default; // normal cursor
        }
Exemplo n.º 2
0
        private void rotationBilinearToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (img == null) // verify if the image is already opened
            {
                return;
            }
            Cursor = Cursors.WaitCursor; // clock cursor
            float angleRad = 0;

            //copy Undo Image
            imgUndo = img.Copy();

            InputBox form = new InputBox("Qual o valor do ângulo a rodar?");

            form.ShowDialog();
            int angle = Convert.ToInt32(form.ValueTextBox.Text);

            angleRad = (float)(Math.PI / 180) * angle;

            ImageClass.Rotation_Bilinear(img, imgUndo, angleRad);

            ImageViewer.Image = img.Bitmap;
            ImageViewer.Refresh();    // refresh image on the screen

            Cursor = Cursors.Default; // normal cursor
        }
Exemplo n.º 3
0
        private void biLinearToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            if (img == null) // verify if the image is already opened
            {
                return;
            }
            Cursor = Cursors.WaitCursor; // clock cursor

            //copy Undo Image
            imgUndo = img.Copy();

            InputBox formr = new InputBox("Rotation (degrees)?");

            formr.ShowDialog();
            int   degrees = Convert.ToInt32(formr.ValueTextBox.Text);
            float radian  = degrees * (float)Math.PI / 180;

            ImageClass.Rotation_Bilinear(img, imgUndo, radian);

            ImageViewer.Image = img.Bitmap;
            ImageViewer.Refresh();    // refresh image on the screen

            Cursor = Cursors.Default; // normal cursor
        }