private void menuItemResize_Click(object sender, EventArgs e)
        {
            var rFrm = new InsertTextForm1();

            rFrm.NewWidth  = imageHandler.CurrentBitmap.Width;
            rFrm.NewHeight = imageHandler.CurrentBitmap.Height;
            if (rFrm.ShowDialog() == DialogResult.OK)
            {
                Cursor = Cursors.WaitCursor;
                imageHandler.RestorePrevious();

                if (rFrm.NewWidth < Screen.PrimaryScreen.Bounds.Width && rFrm.NewHeight < Screen.PrimaryScreen.Bounds.Height)
                {
                    imageHandler.Resize(rFrm.NewWidth, rFrm.NewHeight);
                    AutoScroll  = false;
                    WindowState = FormWindowState.Normal;
                    ClientSize  = imageHandler.GetBitmapSize();
                }
                AutoScrollMinSize = new Size(Convert.ToInt32(imageHandler.CurrentBitmap.Width),
                                             Convert.ToInt32(imageHandler.CurrentBitmap.Height));
                ClientSize = imageHandler.GetBitmapSize();
                Invalidate();
                Cursor = Cursors.Default;
            }
        }
Exemple #2
0
        private void menuItemResize_Click(object sender, EventArgs e)
        {
            InsertTextForm1 rFrm = new InsertTextForm1();

            rFrm.NewWidth  = imageHandler.CurrentBitmap.Width;
            rFrm.NewHeight = imageHandler.CurrentBitmap.Height;
            if (rFrm.ShowDialog() == DialogResult.OK)
            {
                this.Cursor = Cursors.WaitCursor;
                imageHandler.RestorePrevious();
                imageHandler.Resize(rFrm.NewWidth, rFrm.NewHeight);
                this.AutoScrollMinSize = new Size(Convert.ToInt32(imageHandler.CurrentBitmap.Width * zoomFactor), Convert.ToInt32(imageHandler.CurrentBitmap.Height * zoomFactor));
                this.Invalidate();
                this.Cursor = Cursors.Default;
            }
        }
Exemple #3
0
 private void menuItemResize_Click(object sender, EventArgs e)
 {
     InsertTextForm1 rFrm = new InsertTextForm1();
     rFrm.NewWidth = imageHandler.CurrentBitmap.Width;
     rFrm.NewHeight = imageHandler.CurrentBitmap.Height;
     if (rFrm.ShowDialog() == DialogResult.OK)
     {
         this.Cursor = Cursors.WaitCursor;
         imageHandler.RestorePrevious();
         imageHandler.Resize(rFrm.NewWidth, rFrm.NewHeight);
         this.AutoScrollMinSize = new Size(Convert.ToInt32(imageHandler.CurrentBitmap.Width * zoomFactor), Convert.ToInt32(imageHandler.CurrentBitmap.Height * zoomFactor));
         this.Invalidate();
         this.Cursor = Cursors.Default;
     }
 }