Example #1
0
        private void ChangeImageSize()
        {
            Size oldSize = form.Image.Size;

            using (ImageSizeForm imageSizeForm = new ImageSizeForm(oldSize))
            {
                if (imageSizeForm.ShowDialog() == DialogResult.OK)
                {
                    Size size = imageSizeForm.Result;

                    if (size != oldSize)
                    {
                        Image img = ImageHelpers.ResizeImage(form.Image, size);

                        if (img != null)
                        {
                            form.InitBackground(img);
                            isAnnotated = true;
                        }
                    }
                }
            }
        }
Example #2
0
        private void ChangeImageSize()
        {
            Size oldSize = Form.Canvas.Size;

            using (ImageSizeForm imageSizeForm = new ImageSizeForm(oldSize, Options.ImageEditorInterpolationMode))
            {
                if (imageSizeForm.ShowDialog(Form) == DialogResult.OK)
                {
                    Size size = imageSizeForm.ImageSize;
                    Options.ImageEditorInterpolationMode = imageSizeForm.InterpolationMode;

                    if (size != oldSize)
                    {
                        InterpolationMode interpolationMode = GetInterpolationMode(Options.ImageEditorInterpolationMode);
                        Image             img = ImageHelpers.ResizeImage(Form.Canvas, size, interpolationMode);

                        if (img != null)
                        {
                            UpdateCanvas(img);
                        }
                    }
                }
            }
        }