Пример #1
0
        private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ImageSaveFileDialog.Filter = "PNG Files (*.png)|*.png|All Files (*.*)|*.*";
            var now = DateTime.Now;

            ImageSaveFileDialog.FileName = $"Clipboard_{now.ToString("yyyy-MM-dd_HH-mm-ss")}.png";
            if (ImageSaveFileDialog.ShowDialog() == DialogResult.OK)
            {
                ImageBoxControl.Image.Save(ImageSaveFileDialog.FileName);
            }
        }
Пример #2
0
        protected virtual void SaveImageAsToolStripMenuItemClick(object sender, EventArgs e)
        {
            ImageSaveFileDialog.FileName = string.Empty;

            if (PreviewImagePictureBox.Image == default)
            {
                return;
            }

            if (ImageSaveFileDialog.ShowDialog(this) == DialogResult.OK)
            {
                SaveImage(ImageSaveFileDialog.FileName);
            }
        }