コード例 #1
0
ファイル: ImageForm.cs プロジェクト: Balakov/file-ranger
        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);
            }
        }