Beispiel #1
0
        private void zoomToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (img == null)             // verify if the image is already opened
            {
                return;
            }

            using (ScaleForm form = new ScaleForm())
            {
                if (form.ShowDialog() == DialogResult.OK)
                {
                    Cursor = Cursors.WaitCursor;                     // clock cursor
                    //copy Undo Image
                    imgUndo = img.Copy();
                    if (form.useCenter)
                    {
                        ImageClass.Scale_point_xy(img, imgUndo, form.scale, form.xCenter, form.yCenter);
                    }
                    else
                    {
                        ImageClass.Scale(img, imgUndo, form.scale);
                    }

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

                    Cursor = Cursors.Default;                  // normal cursor
                }
            }
        }
Beispiel #2
0
        private void zoomToolStripMenuItem1_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 formz = new InputBox("Zoom (factor)?");

            formz.ShowDialog();
            string factorZ  = formz.ValueTextBox.Text;
            bool   successc = float.TryParse(factorZ, out float j);

            if (successc && j > 0)
            {
                ImageClass.Scale(img, imgUndo, j);


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

                Cursor = Cursors.Default; // normal cursor
            }
            else
            {
                MessageBox.Show("Value for Zoom must be a number bigger than zero.", "Error",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Error); // for Error
            }
        }
Beispiel #3
0
        private void scaleToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //copy Undo Image
            imgUndo = img.Copy();

            InputBox form = new InputBox("Escala");

            form.ShowDialog();
            float scaleFactor = Convert.ToSingle(form.ValueTextBox.Text);


            ImageClass.Scale(img, img, scaleFactor);
        }
        private void simpleToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (img == null) // verify if the image is already opened
            {
                return;
            }

            InputBox form = new InputBox("simple_zoom");

            form.ShowDialog();
            float scaleFactor = Convert.ToSingle(form.textBoxBright.Text);

            imgUndo = img.Copy();
            ImageClass.Scale(img, imgUndo, scaleFactor);

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

            Cursor = Cursors.Default; // normal cursor
        }
        private void zoomToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (img == null) // protege de executar a função sem ainda ter aberto a imagem
            {
                return;
            }
            Cursor = Cursors.WaitCursor; // cursor relogio

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

            InputBox form = new InputBox();

            form.ShowDialog();

            ImageClass.Scale(img, form.getValue);

            ImageViewer.Refresh();    // atualiza imagem no ecrã

            Cursor = Cursors.Default; // cursor normal
        }
        private void zoomToolStripMenuItem_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 form = new InputBox("Qual o valor de Zoom?");

            form.ShowDialog();
            float scaleFactor = (float)Convert.ToDecimal(form.ValueTextBox.Text);

            ImageClass.Scale(img, imgUndo, scaleFactor);

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

            Cursor = Cursors.Default; // normal cursor
        }