private void SaveImageButton_Click(object sender, EventArgs e) { ITheme theme = PluginMain.GetApplication().VisualTheme; SaveImageDialog save = new SaveImageDialog(); save.ThemeChanged(theme); save.CanChangeImageSize = false; save.FileName = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), Resources.Strings.Label_QuadrantAnalysis + " " + DateTime.Now.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture)); if (save.ShowDialog() == DialogResult.OK) { // Image Saved (save occurs in SaveDialog) string filename = save.FileName; if (System.IO.File.Exists(filename)) { if (MessageDialog.Show("File exists. Overwrite?", "File Save", MessageBoxButtons.YesNo) != DialogResult.Yes) { return; } } zedChart.GetImage().Save(save.FileName, save.ImageFormat); } save.Dispose(); }
private void opslaan(object obj, EventArgs ea) { SaveImageDialog dialog = new SaveImageDialog(); if (dialog.ShowDialog() == DialogResult.OK) { switch (dialog.SelectedImageType) { case SaveImageDialog.ImageType.Bmp: schetscontrol.Schets.Bitmap.Save(dialog.FileName); break; case SaveImageDialog.ImageType.Jpeg: schetscontrol.Schets.Bitmap.Save(dialog.FileName, ImageFormat.Jpeg); break; case SaveImageDialog.ImageType.Png: schetscontrol.Schets.Bitmap.Save(dialog.FileName, ImageFormat.Png); break; case SaveImageDialog.ImageType.Schets: File.WriteAllText(dialog.FileName, schetscontrol.Schets.Historie.Serialiseer()); break; } } }
private void SavePathButton_Click(object sender, EventArgs e) { if (SaveImageDialog.ShowDialog() == DialogResult.OK) { SavePathBox.Text = SaveImageDialog.FileName; OriginalImageBox.Image.Save(SavePathBox.Text); } }
private void Save(int index) { if (SaveImageDialog.ShowDialog() == DialogResult.OK) { string filename = SaveImageDialog.FileName; Bitmap image = (ShowMI.Checked && images[index].Result != null) ? images[index].Result : images[index].Source; image.Save(filename, filename.EndsWith(".bmp") ? ImageFormat.Bmp : ImageFormat.Jpeg); Message.Info("Image saved!", Text); } }
private void Menu_File_SaveImage_Click(object sender, EventArgs e) { if (SaveImageDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { try { ResourceChart.SaveImage(SaveImageDialog.FileName, ChartImageFormat.Png); } catch (Exception ex) { Utility.ErrorReporter.SendErrorReport(ex, "資源チャート画像の保存に失敗しました。"); } } }
private void SearchOutputPath_Click(object sender, EventArgs e) { try { SaveImageDialog.FileName = System.IO.Path.GetFileName(OutputPath.Text); SaveImageDialog.InitialDirectory = string.IsNullOrWhiteSpace(OutputPath.Text) ? "" : System.IO.Path.GetDirectoryName(OutputPath.Text); } catch (Exception) { } if (SaveImageDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { OutputPath.Text = SaveImageDialog.FileName; } }
private void SaveMenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e) { if (e.ClickedItem.Text == "保存") { SaveMenu.Close(); SaveImageDialog.FileName = Path.GetFileNameWithoutExtension(mediaEntity.MediaUrl); SaveImageDialog.Filter = "JPEG形式|*.jpg;*.jpeg|PNG形式|*.png|GIF形式|*.gif"; //SaveImageDialog.Filter = Path.GetExtension(mediaEntity.MediaUrl); SaveImageDialog.ShowDialog(); Console.WriteLine("保存"); } }
private void RightClickSaveImage(object sender, MouseEventArgs e) { if ((e.Button == System.Windows.Forms.MouseButtons.Right) && (sender != null)) { if (SaveImageDialog.ShowDialog() == DialogResult.OK) { PictureBox pb = sender as PictureBox; Bitmap output = new Bitmap(pb.Image); output.Save(SaveImageDialog.FileName, System.Drawing.Imaging.ImageFormat.Png); } } }
private void Display_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { InitializeTree(); } else if (e.Button == MouseButtons.Right) { if (SaveImageDialog.ShowDialog() == DialogResult.OK) { canvas.Save(SaveImageDialog.FileName); } } }
private void TopMenu_File_SaveImage_Click(object sender, EventArgs e) { if (CurrentImage == null) { System.Media.SystemSounds.Exclamation.Play(); return; } if (SaveImageDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { try { CurrentImage.Save(SaveImageDialog.FileName, ImageFormat.Png); } catch (Exception ex) { MessageBox.Show(SaveImageDialog.FileName + "\r\nへの保存に失敗しました。\r\n" + ex.GetType().Name + "\r\n" + ex.Message); } } }
private void CloseImage_Click(object sender, EventArgs e) { ContextMenuStrip menu = (ContextMenuStrip)((ToolStripMenuItem)sender).Owner; PictureBox box = (PictureBox)menu.SourceControl; int index = int.Parse(box.Name.Remove(0, 2)); if (images[index].Result != null) { if (Message.Info("Do you want to save changes?", Text, true) == DialogResult.Yes) { if (SaveImageDialog.ShowDialog() == DialogResult.OK) { images[index].Result.Save(SaveImageDialog.FileName); Message.Info("Image saved!", Text); } } } images.Remove(index); Tabs.TabPages.RemoveByKey("TP" + index); UpdateUI(); }
private void RightClickSaveImage(object sender, MouseEventArgs e) { if ((e.Button == System.Windows.Forms.MouseButtons.Right) && (sender != null)) { if (SaveImageDialog.ShowDialog() == DialogResult.OK) { if (sender is PictureBox) { PictureBox pb = sender as PictureBox; Bitmap output = new Bitmap(pb.Image); output.Save(SaveImageDialog.FileName, System.Drawing.Imaging.ImageFormat.Png); } else if (sender is System.Windows.Forms.DataVisualization.Charting.Chart) { System.Windows.Forms.DataVisualization.Charting.Chart chart = sender as System.Windows.Forms.DataVisualization.Charting.Chart; ChartProperties chartprops = new ChartProperties(); chartprops.ExportChartAsPNG(chart, SaveImageDialog.FileName, 800, 800); } } } }
public DialogResult SaveAs() { return(SaveImageDialog.ShowDialog()); }