- Timestamp:
- 10/29/10 12:55:50 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Visualization.ChartControlsExtensions/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Visualization.ChartControlsExtensions/3.3/EnhancedChart.Designer.cs
r4637 r4654 47 47 this.components = new System.ComponentModel.Container(); 48 48 this.contextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); 49 this. saveImageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();49 this.exportChartToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 50 50 this.copyImageToClipboardBitmapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 51 this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); 51 52 this.contextMenuStrip.SuspendLayout(); 52 53 ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); … … 56 57 // 57 58 this.contextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 58 this. saveImageToolStripMenuItem,59 this.exportChartToolStripMenuItem, 59 60 this.copyImageToClipboardBitmapToolStripMenuItem}); 60 61 this.contextMenuStrip.Name = "contextMenuStrip"; 61 this.contextMenuStrip.Size = new System.Drawing.Size(257, 70);62 this.contextMenuStrip.Size = new System.Drawing.Size(257, 48); 62 63 // 63 // saveImageToolStripMenuItem64 // exportChartToolStripMenuItem 64 65 // 65 this. saveImageToolStripMenuItem.Name = "saveImageToolStripMenuItem";66 this. saveImageToolStripMenuItem.Size = new System.Drawing.Size(256, 22);67 this. saveImageToolStripMenuItem.Text = "Save Image";68 this. saveImageToolStripMenuItem.Click += new System.EventHandler(this.saveImageToolStripMenuItem_Click);66 this.exportChartToolStripMenuItem.Name = "exportChartToolStripMenuItem"; 67 this.exportChartToolStripMenuItem.Size = new System.Drawing.Size(256, 22); 68 this.exportChartToolStripMenuItem.Text = "Export Chart"; 69 this.exportChartToolStripMenuItem.Click += new System.EventHandler(this.exportChartToolStripMenuItem_Click); 69 70 // 70 71 // copyImageToClipboardBitmapToolStripMenuItem … … 74 75 this.copyImageToClipboardBitmapToolStripMenuItem.Text = "Copy Image to Clipboard (Bitmap)"; 75 76 this.copyImageToClipboardBitmapToolStripMenuItem.Click += new System.EventHandler(this.copyImageToClipboardBitmapToolStripMenuItem_Click); 77 // 78 // saveFileDialog 79 // 80 this.saveFileDialog.Filter = "\"Bitmap (*.bmp)|*.bmp|JPEG (*.jpg)|*.jpg|EMF (*.emf)|*.emf|PNG (*.png)|*.png|GIF " + 81 "(*.gif)|*.gif|TIFF (*.tif)|*.tif\""; 82 this.saveFileDialog.FilterIndex = 2; 76 83 // 77 84 // EnhancedChart … … 87 94 88 95 private System.Windows.Forms.ContextMenuStrip contextMenuStrip; 89 private System.Windows.Forms.ToolStripMenuItem saveImageToolStripMenuItem;96 private System.Windows.Forms.ToolStripMenuItem exportChartToolStripMenuItem; 90 97 private System.Windows.Forms.ToolStripMenuItem copyImageToClipboardBitmapToolStripMenuItem; 98 private System.Windows.Forms.SaveFileDialog saveFileDialog; 91 99 } 92 100 } -
trunk/sources/HeuristicLab.Visualization.ChartControlsExtensions/3.3/EnhancedChart.cs
r4646 r4654 94 94 95 95 public double ChartX(double pixelX, int width) { 96 return ChartStartPosition.X - (pixelX - PixelStartPosition.X) * 96 return ChartStartPosition.X - (pixelX - PixelStartPosition.X) * 97 97 (ChartArea.AxisX.ScaleView.ViewMaximum - ChartArea.AxisX.ScaleView.ViewMinimum) / 98 98 (width * ChartArea.Position.Width * ChartArea.InnerPlotPosition.Width / 100 / 100); 99 99 } 100 100 public double ChartY(double pixelY, int height) { 101 return ChartStartPosition.Y + (pixelY - PixelStartPosition.Y) * 101 return ChartStartPosition.Y + (pixelY - PixelStartPosition.Y) * 102 102 (ChartArea.AxisY.ScaleView.ViewMaximum - ChartArea.AxisY.ScaleView.ViewMinimum) / 103 103 (height * ChartArea.Position.Height * ChartArea.InnerPlotPosition.Height / 100 / 100); … … 138 138 #endregion 139 139 140 private void saveImageToolStripMenuItem_Click(object sender, System.EventArgs e) { 141 SaveFileDialog saveFileDialog = new SaveFileDialog(); 142 143 // Sets the current file name filter string, which determines 144 // the choices that appear in the "Save as file type" or 145 // "Files of type" box in the dialog box. 146 saveFileDialog.Filter = "Bitmap (*.bmp)|*.bmp|JPEG (*.jpg)|*.jpg|EMF (*.emf)|*.emf|PNG (*.png)|*.png|GIF (*.gif)|*.gif|TIFF (*.tif)|*.tif"; 147 saveFileDialog.FilterIndex = 2; 148 saveFileDialog.RestoreDirectory = true; 149 140 private void exportChartToolStripMenuItem_Click(object sender, System.EventArgs e) { 150 141 // Set image file format 151 142 if (saveFileDialog.ShowDialog() == DialogResult.OK) {
Note: See TracChangeset
for help on using the changeset viewer.