Esempio n. 1
0
        private void stretchToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                var bitmap = pictureEdit1.Image as Bitmap;
                if (bitmap == null)
                {
                    return;
                }
                var size = bitmap.Size;
                using (var stretchDialog = new StretchDialog(new Size(size.Width, size.Height)))
                {
                    if (stretchDialog.ShowDialog() != DialogResult.OK)
                    {
                        return;
                    }

                    var imageSize = stretchDialog.ImageSize;

                    using (var builder = new StretchBuilder(imageSize))
                    {
                        pictureEdit1.Image = builder.Stretch(bitmap);
                    }
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }
Esempio n. 2
0
        private void stretch_ItemClick(object sender, ItemClickEventArgs e)
        {
            try
            {
                var bitmap = pictureEdit1.Image as Bitmap;
                if (bitmap == null)
                {
                    return;
                }
                using (var stretchDialog = new StretchDialog(bitmap.Size))
                {
                    if (stretchDialog.ShowDialog() != DialogResult.OK)
                    {
                        return;
                    }

                    Size imageSize = stretchDialog.ImageSize;

                    using (var builder = new StretchBuilder(imageSize))
                        pictureEdit1.Image = builder.Stretch(bitmap);
                }
            }
            catch (Exception exception)
            {
                XtraMessageBox.Show(exception.Message);
            }
        }
Esempio n. 3
0
        private void stretch_ItemClick(object sender, ItemClickEventArgs e)
        {
            try
            {
                var bitmap = pictureEdit1.Image as Bitmap;
                if (bitmap == null) return;
                var size = bitmap.Size;
                using (var stretchDialog = new StretchDialog(new Size(size.Width, size.Height)))
                {
                    if (stretchDialog.ShowDialog() != DialogResult.OK) return;

                    var imageSize = stretchDialog.ImageSize;

                    using (var builder = new StretchBuilder(imageSize))
                    {
                        pictureEdit1.Image = builder.Stretch(bitmap);
                    }
                }
            }
            catch (Exception exception)
            {
                XtraMessageBox.Show(exception.Message);
            }
        }