Index: trunk/sources/HeuristicLab.Visualization.ChartControlsExtensions/3.3/ImageExportDialog.Designer.cs
===================================================================
--- trunk/sources/HeuristicLab.Visualization.ChartControlsExtensions/3.3/ImageExportDialog.Designer.cs	(revision 6640)
+++ trunk/sources/HeuristicLab.Visualization.ChartControlsExtensions/3.3/ImageExportDialog.Designer.cs	(revision 6641)
@@ -36,6 +36,6 @@
       this.label5 = new System.Windows.Forms.Label();
       this.label6 = new System.Windows.Forms.Label();
-      this.axisComboBox = new System.Windows.Forms.ComboBox();
-      this.scalesComboBox = new System.Windows.Forms.ComboBox();
+      this.axisFontSizeComboBox = new System.Windows.Forms.ComboBox();
+      this.scalesFontSizeComboBox = new System.Windows.Forms.ComboBox();
       this.cancelButton = new System.Windows.Forms.Button();
       this.label9 = new System.Windows.Forms.Label();
@@ -48,8 +48,11 @@
       this.label15 = new System.Windows.Forms.Label();
       this.groupBox3 = new System.Windows.Forms.GroupBox();
+      this.label18 = new System.Windows.Forms.Label();
       this.label12 = new System.Windows.Forms.Label();
       this.label11 = new System.Windows.Forms.Label();
       this.label7 = new System.Windows.Forms.Label();
-      this.titleComboBox = new System.Windows.Forms.ComboBox();
+      this.legendFontSizeComboBox = new System.Windows.Forms.ComboBox();
+      this.label17 = new System.Windows.Forms.Label();
+      this.titleFontSizeComboBox = new System.Windows.Forms.ComboBox();
       this.label16 = new System.Windows.Forms.Label();
       this.heightNumericUD = new System.Windows.Forms.NumericUpDown();
@@ -101,5 +104,5 @@
       this.okButton.Size = new System.Drawing.Size(75, 23);
       this.okButton.TabIndex = 13;
-      this.okButton.Text = "Ok";
+      this.okButton.Text = "Save";
       this.okButton.UseVisualStyleBackColor = true;
       this.okButton.Click += new System.EventHandler(this.okButton_Click);
@@ -170,8 +173,13 @@
       // widthNumericUD
       // 
-      this.widthNumericUD.DecimalPlaces = 1;
+      this.widthNumericUD.DecimalPlaces = 2;
+      this.widthNumericUD.Increment = new decimal(new int[] {
+            5,
+            0,
+            0,
+            65536});
       this.widthNumericUD.Location = new System.Drawing.Point(76, 410);
       this.widthNumericUD.Maximum = new decimal(new int[] {
-            42,
+            1000,
             0,
             0,
@@ -181,5 +189,5 @@
             0,
             0,
-            0});
+            131072});
       this.widthNumericUD.Name = "widthNumericUD";
       this.widthNumericUD.Size = new System.Drawing.Size(75, 20);
@@ -210,10 +218,10 @@
       this.label6.Text = "Width:";
       // 
-      // axisComboBox
-      // 
-      this.axisComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+      // axisFontSizeComboBox
+      // 
+      this.axisFontSizeComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                   | System.Windows.Forms.AnchorStyles.Right)));
-      this.axisComboBox.FormattingEnabled = true;
-      this.axisComboBox.Items.AddRange(new object[] {
+      this.axisFontSizeComboBox.FormattingEnabled = true;
+      this.axisFontSizeComboBox.Items.AddRange(new object[] {
             "6",
             "8",
@@ -227,17 +235,17 @@
             "36",
             "72"});
-      this.axisComboBox.Location = new System.Drawing.Point(54, 46);
-      this.axisComboBox.Name = "axisComboBox";
-      this.axisComboBox.Size = new System.Drawing.Size(84, 21);
-      this.axisComboBox.TabIndex = 3;
-      this.axisComboBox.TextChanged += new System.EventHandler(this.axisComboBox_TextChanged);
-      this.axisComboBox.Validating += new System.ComponentModel.CancelEventHandler(this.axisComboBox_Validating);
-      // 
-      // scalesComboBox
-      // 
-      this.scalesComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+      this.axisFontSizeComboBox.Location = new System.Drawing.Point(54, 46);
+      this.axisFontSizeComboBox.Name = "axisFontSizeComboBox";
+      this.axisFontSizeComboBox.Size = new System.Drawing.Size(84, 21);
+      this.axisFontSizeComboBox.TabIndex = 3;
+      this.axisFontSizeComboBox.TextChanged += new System.EventHandler(this.axisFontSizeComboBox_TextChanged);
+      this.axisFontSizeComboBox.Validating += new System.ComponentModel.CancelEventHandler(this.numericComboBox_Validating);
+      // 
+      // scalesFontSizeComboBox
+      // 
+      this.scalesFontSizeComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                   | System.Windows.Forms.AnchorStyles.Right)));
-      this.scalesComboBox.FormattingEnabled = true;
-      this.scalesComboBox.Items.AddRange(new object[] {
+      this.scalesFontSizeComboBox.FormattingEnabled = true;
+      this.scalesFontSizeComboBox.Items.AddRange(new object[] {
             "4",
             "5",
@@ -255,10 +263,10 @@
             "36",
             "72"});
-      this.scalesComboBox.Location = new System.Drawing.Point(54, 73);
-      this.scalesComboBox.Name = "scalesComboBox";
-      this.scalesComboBox.Size = new System.Drawing.Size(84, 21);
-      this.scalesComboBox.TabIndex = 5;
-      this.scalesComboBox.TextChanged += new System.EventHandler(this.scalesComboBox_TextChanged);
-      this.scalesComboBox.Validating += new System.ComponentModel.CancelEventHandler(this.scalesComboBox_Validating);
+      this.scalesFontSizeComboBox.Location = new System.Drawing.Point(54, 73);
+      this.scalesFontSizeComboBox.Name = "scalesFontSizeComboBox";
+      this.scalesFontSizeComboBox.Size = new System.Drawing.Size(84, 21);
+      this.scalesFontSizeComboBox.TabIndex = 5;
+      this.scalesFontSizeComboBox.TextChanged += new System.EventHandler(this.scalesFontSizeComboBox_TextChanged);
+      this.scalesFontSizeComboBox.Validating += new System.ComponentModel.CancelEventHandler(this.numericComboBox_Validating);
       // 
       // cancelButton
@@ -297,5 +305,5 @@
       this.groupBox1.Controls.Add(this.label4);
       this.groupBox1.Controls.Add(this.label3);
-      this.groupBox1.Location = new System.Drawing.Point(13, 166);
+      this.groupBox1.Location = new System.Drawing.Point(12, 154);
       this.groupBox1.Name = "groupBox1";
       this.groupBox1.Size = new System.Drawing.Size(258, 82);
@@ -310,5 +318,5 @@
       this.groupBox2.Controls.Add(this.label14);
       this.groupBox2.Controls.Add(this.label15);
-      this.groupBox2.Location = new System.Drawing.Point(13, 73);
+      this.groupBox2.Location = new System.Drawing.Point(12, 64);
       this.groupBox2.Name = "groupBox2";
       this.groupBox2.Size = new System.Drawing.Size(258, 84);
@@ -357,4 +365,5 @@
       // groupBox3
       // 
+      this.groupBox3.Controls.Add(this.label18);
       this.groupBox3.Controls.Add(this.label12);
       this.groupBox3.Controls.Add(this.label11);
@@ -362,14 +371,25 @@
       this.groupBox3.Controls.Add(this.label1);
       this.groupBox3.Controls.Add(this.label9);
-      this.groupBox3.Controls.Add(this.scalesComboBox);
+      this.groupBox3.Controls.Add(this.legendFontSizeComboBox);
+      this.groupBox3.Controls.Add(this.label17);
+      this.groupBox3.Controls.Add(this.scalesFontSizeComboBox);
       this.groupBox3.Controls.Add(this.label10);
-      this.groupBox3.Controls.Add(this.axisComboBox);
-      this.groupBox3.Controls.Add(this.titleComboBox);
-      this.groupBox3.Location = new System.Drawing.Point(13, 259);
+      this.groupBox3.Controls.Add(this.axisFontSizeComboBox);
+      this.groupBox3.Controls.Add(this.titleFontSizeComboBox);
+      this.groupBox3.Location = new System.Drawing.Point(12, 242);
       this.groupBox3.Name = "groupBox3";
-      this.groupBox3.Size = new System.Drawing.Size(258, 105);
+      this.groupBox3.Size = new System.Drawing.Size(258, 131);
       this.groupBox3.TabIndex = 4;
       this.groupBox3.TabStop = false;
       this.groupBox3.Text = "Font Size";
+      // 
+      // label18
+      // 
+      this.label18.AutoSize = true;
+      this.label18.Location = new System.Drawing.Point(144, 105);
+      this.label18.Name = "label18";
+      this.label18.Size = new System.Drawing.Size(16, 13);
+      this.label18.TabIndex = 0;
+      this.label18.Text = "pt";
       // 
       // label12
@@ -400,10 +420,47 @@
       this.label7.Text = "pt";
       // 
-      // titleComboBox
-      // 
-      this.titleComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+      // legendFontSizeComboBox
+      // 
+      this.legendFontSizeComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                   | System.Windows.Forms.AnchorStyles.Right)));
-      this.titleComboBox.FormattingEnabled = true;
-      this.titleComboBox.Items.AddRange(new object[] {
+      this.legendFontSizeComboBox.FormattingEnabled = true;
+      this.legendFontSizeComboBox.Items.AddRange(new object[] {
+            "4",
+            "5",
+            "6",
+            "7",
+            "8",
+            "9",
+            "10",
+            "11",
+            "12",
+            "14",
+            "16",
+            "18",
+            "24",
+            "36",
+            "72"});
+      this.legendFontSizeComboBox.Location = new System.Drawing.Point(54, 100);
+      this.legendFontSizeComboBox.Name = "legendFontSizeComboBox";
+      this.legendFontSizeComboBox.Size = new System.Drawing.Size(84, 21);
+      this.legendFontSizeComboBox.TabIndex = 5;
+      this.legendFontSizeComboBox.TextChanged += new System.EventHandler(this.legendFontSizeComboBox_TextChanged);
+      this.legendFontSizeComboBox.Validating += new System.ComponentModel.CancelEventHandler(this.numericComboBox_Validating);
+      // 
+      // label17
+      // 
+      this.label17.AutoSize = true;
+      this.label17.Location = new System.Drawing.Point(6, 105);
+      this.label17.Name = "label17";
+      this.label17.Size = new System.Drawing.Size(46, 13);
+      this.label17.TabIndex = 4;
+      this.label17.Text = "Legend:";
+      // 
+      // titleFontSizeComboBox
+      // 
+      this.titleFontSizeComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.titleFontSizeComboBox.FormattingEnabled = true;
+      this.titleFontSizeComboBox.Items.AddRange(new object[] {
             "6",
             "8",
@@ -417,10 +474,10 @@
             "36",
             "72"});
-      this.titleComboBox.Location = new System.Drawing.Point(54, 19);
-      this.titleComboBox.Name = "titleComboBox";
-      this.titleComboBox.Size = new System.Drawing.Size(84, 21);
-      this.titleComboBox.TabIndex = 1;
-      this.titleComboBox.TextChanged += new System.EventHandler(this.titleComboBox_TextChanged);
-      this.titleComboBox.Validating += new System.ComponentModel.CancelEventHandler(this.titleComboBox_Validating);
+      this.titleFontSizeComboBox.Location = new System.Drawing.Point(54, 19);
+      this.titleFontSizeComboBox.Name = "titleFontSizeComboBox";
+      this.titleFontSizeComboBox.Size = new System.Drawing.Size(84, 21);
+      this.titleFontSizeComboBox.TabIndex = 1;
+      this.titleFontSizeComboBox.TextChanged += new System.EventHandler(this.titleFontSizeComboBox_TextChanged);
+      this.titleFontSizeComboBox.Validating += new System.ComponentModel.CancelEventHandler(this.numericComboBox_Validating);
       // 
       // label16
@@ -435,8 +492,13 @@
       // heightNumericUD
       // 
-      this.heightNumericUD.DecimalPlaces = 1;
+      this.heightNumericUD.DecimalPlaces = 2;
+      this.heightNumericUD.Increment = new decimal(new int[] {
+            5,
+            0,
+            0,
+            65536});
       this.heightNumericUD.Location = new System.Drawing.Point(76, 436);
       this.heightNumericUD.Maximum = new decimal(new int[] {
-            42,
+            1000,
             0,
             0,
@@ -446,5 +508,5 @@
             0,
             0,
-            0});
+            131072});
       this.heightNumericUD.Name = "heightNumericUD";
       this.heightNumericUD.Size = new System.Drawing.Size(75, 20);
@@ -497,5 +559,5 @@
       this.chartAreaComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
       this.chartAreaComboBox.FormattingEnabled = true;
-      this.chartAreaComboBox.Location = new System.Drawing.Point(76, 46);
+      this.chartAreaComboBox.Location = new System.Drawing.Point(76, 37);
       this.chartAreaComboBox.Name = "chartAreaComboBox";
       this.chartAreaComboBox.Size = new System.Drawing.Size(189, 21);
@@ -521,7 +583,4 @@
       this.lengthUnitComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
       this.lengthUnitComboBox.FormattingEnabled = true;
-      this.lengthUnitComboBox.Items.AddRange(new object[] {
-            "inch",
-            "cm"});
       this.lengthUnitComboBox.Location = new System.Drawing.Point(157, 422);
       this.lengthUnitComboBox.Name = "lengthUnitComboBox";
@@ -534,7 +593,4 @@
       this.resolutionUnitComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
       this.resolutionUnitComboBox.FormattingEnabled = true;
-      this.resolutionUnitComboBox.Items.AddRange(new object[] {
-            "dpi",
-            "dpcm"});
       this.resolutionUnitComboBox.Location = new System.Drawing.Point(157, 383);
       this.resolutionUnitComboBox.Name = "resolutionUnitComboBox";
@@ -546,5 +602,5 @@
       // 
       this.label8.AutoSize = true;
-      this.label8.Location = new System.Drawing.Point(10, 49);
+      this.label8.Location = new System.Drawing.Point(10, 40);
       this.label8.Name = "label8";
       this.label8.Size = new System.Drawing.Size(60, 13);
@@ -634,6 +690,6 @@
     private System.Windows.Forms.Label label5;
     private System.Windows.Forms.Label label6;
-    private System.Windows.Forms.ComboBox axisComboBox;
-    private System.Windows.Forms.ComboBox scalesComboBox;
+    private System.Windows.Forms.ComboBox axisFontSizeComboBox;
+    private System.Windows.Forms.ComboBox scalesFontSizeComboBox;
     private System.Windows.Forms.Button cancelButton;
     private System.Windows.Forms.Label label9;
@@ -654,5 +710,5 @@
     private System.Windows.Forms.Label label11;
     private System.Windows.Forms.Label label7;
-    private System.Windows.Forms.ComboBox titleComboBox;
+    private System.Windows.Forms.ComboBox titleFontSizeComboBox;
     private System.Windows.Forms.ComboBox lengthUnitComboBox;
     private System.Windows.Forms.ComboBox resolutionUnitComboBox;
@@ -662,4 +718,7 @@
     private System.Windows.Forms.Label label13;
     private System.Windows.Forms.Label previewZoomLabel;
+    private System.Windows.Forms.Label label18;
+    private System.Windows.Forms.ComboBox legendFontSizeComboBox;
+    private System.Windows.Forms.Label label17;
   }
 }
Index: trunk/sources/HeuristicLab.Visualization.ChartControlsExtensions/3.3/ImageExportDialog.cs
===================================================================
--- trunk/sources/HeuristicLab.Visualization.ChartControlsExtensions/3.3/ImageExportDialog.cs	(revision 6640)
+++ trunk/sources/HeuristicLab.Visualization.ChartControlsExtensions/3.3/ImageExportDialog.cs	(revision 6641)
@@ -29,8 +29,7 @@
 
 namespace HeuristicLab.Visualization.ChartControlsExtensions {
-  public enum LengthUnit { Centimeters = 1, Inches = 2 };
-
   public sealed partial class ImageExportDialog : Form {
     private const float CMPERINCH = 2.54f;
+    private static readonly string DPI = "dpi", DPCM = "dpcm", INCH = "inch", CM = "cm";
     private Chart originalChart, workingChart;
     private bool SuppressEvents { get; set; }
@@ -47,13 +46,27 @@
       this.originalChart = chart;
       InitializeComponent();
+      #region Custom Initialization
       SuppressEvents = true;
-      titleComboBox.Text = "12";
-      resolutionUnitComboBox.SelectedIndex = 0;
-      lengthUnitComboBox.SelectedIndex = 1;
-      resolutionComboBox.Text = "300";
-      SuppressEvents = false;
-      splitContainer.Panel2Collapsed = true;
-      Width = 305;
-      Height = 550;
+      try {
+        resolutionUnitComboBox.Items.Add(DPI);
+        resolutionUnitComboBox.Items.Add(DPCM);
+        lengthUnitComboBox.Items.Add(INCH);
+        lengthUnitComboBox.Items.Add(CM);
+        resolutionUnitComboBox.SelectedIndex = 0;
+        if (System.Globalization.RegionInfo.CurrentRegion.IsMetric)
+          lengthUnitComboBox.SelectedIndex = 1;
+        else lengthUnitComboBox.SelectedIndex = 0;
+
+        titleFontSizeComboBox.Text = "12";
+        axisFontSizeComboBox.Text = "8";
+        scalesFontSizeComboBox.Text = "6";
+        legendFontSizeComboBox.Text = "6";
+        resolutionComboBox.Text = "300";
+        SuppressEvents = false;
+        splitContainer.Panel2Collapsed = true;
+        Width = 305;
+        Height = 550;
+      } finally { SuppressEvents = false; }
+      #endregion
     }
 
@@ -64,8 +77,8 @@
         SuppressEvents = true;
 
-        if (workingChart.Titles.Count == 0) titleComboBox.Text = "12";
+        if (workingChart.Titles.Count == 0) titleFontSizeComboBox.Text = "12";
         else {
           titleTextBox.Text = workingChart.Titles[0].Text;
-          titleComboBox.Text = workingChart.Titles[0].Font.SizeInPoints.ToString();
+          titleFontSizeComboBox.Text = workingChart.Titles[0].Font.SizeInPoints.ToString();
         }
 
@@ -75,6 +88,8 @@
         secondaryYTextBox.Text = area.AxisY2.Title;
 
-        axisComboBox.Text = area.AxisX.TitleFont.SizeInPoints.ToString();
-        scalesComboBox.Text = area.AxisX.LabelStyle.Font.SizeInPoints.ToString();
+        axisFontSizeComboBox.Text = area.AxisX.TitleFont.SizeInPoints.ToString();
+        scalesFontSizeComboBox.Text = area.AxisX.LabelStyle.Font.SizeInPoints.ToString();
+        if (workingChart.Legends.Count == 0) legendFontSizeComboBox.Text = "8";
+        else legendFontSizeComboBox.Text = workingChart.Legends[0].Font.SizeInPoints.ToString();
       } finally {
         SuppressEvents = false;
@@ -87,13 +102,14 @@
 
     private void UpdatePreview() {
-      float dpi = float.Parse(resolutionComboBox.Text);
-      if (resolutionUnitComboBox.SelectedIndex == 1) dpi *= CMPERINCH;
-      float width = (float)widthNumericUD.Value;
-      float height = (float)heightNumericUD.Value;
-      if (lengthUnitComboBox.SelectedIndex == 1) {
-        width /= CMPERINCH; height /= CMPERINCH;
-      }
-      width *= dpi; height *= dpi;
-      if (previewPictureBox.Image != null) previewPictureBox.Image.Dispose();
+      float dpi;
+      float width;
+      float height;
+      GetImageParameters(out dpi, out width, out height);
+
+      if (previewPictureBox.Image != null) {
+        previewPictureBox.Image.Dispose();
+        previewPictureBox.Image = null;
+      }
+
       int previewWidth, previewHeight;
       if (width / height >= 1.0) {
@@ -104,24 +120,42 @@
         previewWidth = (int)Math.Round(width / height * previewHeight);
       }
+
+      float scaleFactor = (float)Math.Min(previewWidth / width, previewHeight / height);
+      if (scaleFactor >= 1) {
+        previewZoomLabel.Text = "100%";
+        previewWidth = (int)Math.Round(width);
+        previewHeight = (int)Math.Round(height);
+      } else previewZoomLabel.Text = (scaleFactor * 100).ToString("0") + "%";
+
       Bitmap image = new Bitmap(previewWidth, previewHeight);
       image.SetResolution(dpi, dpi);
       using (Graphics graphics = Graphics.FromImage(image)) {
-        graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
-        graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
-        graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
-        float scaleFactor = (float)Math.Min(image.Width / width, image.Height / height);
-        previewZoomLabel.Text = (scaleFactor * 100).ToString("0") + "%";
-        graphics.ScaleTransform(scaleFactor, scaleFactor);
-        workingChart.Printing.PrintPaint(graphics, new Rectangle(0, 0, (int)width, (int)height));
+        if (scaleFactor < 1) graphics.ScaleTransform(scaleFactor, scaleFactor);
+        workingChart.Printing.PrintPaint(graphics, new Rectangle(0, 0, (int)Math.Round(width), (int)Math.Round(height)));
       }
       previewPictureBox.Image = image;
     }
 
+    private void GetImageParameters(out float dpi, out float width, out float height) {
+      dpi = float.Parse(resolutionComboBox.Text);
+      if (resolutionUnitComboBox.Text == DPCM) dpi *= CMPERINCH;
+      width = (float)widthNumericUD.Value;
+      height = (float)heightNumericUD.Value;
+      if (lengthUnitComboBox.Text == CM) {
+        width /= CMPERINCH; height /= CMPERINCH;
+      }
+      width *= dpi; height *= dpi;
+    }
+
     protected override void OnShown(EventArgs e) {
-      var prev = originalChart.Serializer.Content;
+      #region Create copy of chart
+      var prevContent = originalChart.Serializer.Content;
+      var prevFormat = originalChart.Serializer.Format;
       originalChart.Serializer.Content = SerializationContents.Default;
+      originalChart.Serializer.Format = SerializationFormat.Binary;
       MemoryStream ms = new MemoryStream();
       originalChart.Serializer.Save(ms);
-      originalChart.Serializer.Content = prev;
+      originalChart.Serializer.Content = prevContent;
+      originalChart.Serializer.Format = prevFormat;
 
       ms.Seek(0, SeekOrigin.Begin);
@@ -129,4 +163,5 @@
       workingChart.Serializer.Load(ms);
       ms.Close();
+      #endregion
 
       chartAreaComboBox.Items.Clear();
@@ -161,4 +196,5 @@
         } else {
           Title t = new Title(titleTextBox.Text);
+          t.Font = ChangeFontSizePt(t.Font, float.Parse(titleFontSizeComboBox.Text));
           workingChart.Titles.Add(t);
         }
@@ -207,8 +243,8 @@
     }
 
-    private void titleComboBox_TextChanged(object sender, EventArgs e) {
+    private void titleFontSizeComboBox_TextChanged(object sender, EventArgs e) {
       if (!SuppressEvents) {
         float fontSize;
-        if (float.TryParse(titleComboBox.Text, out fontSize)) {
+        if (float.TryParse(titleFontSizeComboBox.Text, out fontSize)) {
           if (workingChart.Titles.Count > 0) {
             workingChart.Titles[0].Font = ChangeFontSizePt(workingChart.Titles[0].Font, fontSize);
@@ -219,13 +255,8 @@
     }
 
-    private void titleComboBox_Validating(object sender, CancelEventArgs e) {
-      float number;
-      e.Cancel = !float.TryParse(titleComboBox.Text, out number);
-    }
-
-    private void axisComboBox_TextChanged(object sender, EventArgs e) {
+    private void axisFontSizeComboBox_TextChanged(object sender, EventArgs e) {
       if (!SuppressEvents) {
         float fontSize;
-        if (float.TryParse(axisComboBox.Text, out fontSize)) {
+        if (float.TryParse(axisFontSizeComboBox.Text, out fontSize)) {
           ChartArea area = GetCurrentChartArea();
           foreach (Axis a in area.Axes) {
@@ -237,13 +268,8 @@
     }
 
-    private void axisComboBox_Validating(object sender, CancelEventArgs e) {
-      float number;
-      e.Cancel = !float.TryParse(axisComboBox.Text, out number);
-    }
-
-    private void scalesComboBox_TextChanged(object sender, EventArgs e) {
+    private void scalesFontSizeComboBox_TextChanged(object sender, EventArgs e) {
       if (!SuppressEvents) {
         float fontSize;
-        if (float.TryParse(scalesComboBox.Text, out fontSize)) {
+        if (float.TryParse(scalesFontSizeComboBox.Text, out fontSize)) {
           ChartArea area = GetCurrentChartArea();
           foreach (Axis a in area.Axes) {
@@ -255,7 +281,20 @@
     }
 
-    private void scalesComboBox_Validating(object sender, CancelEventArgs e) {
+    private void legendFontSizeComboBox_TextChanged(object sender, EventArgs e) {
+      if (!SuppressEvents) {
+        float fontSize;
+        if (float.TryParse(legendFontSizeComboBox.Text, out fontSize)) {
+          foreach (Legend l in workingChart.Legends) {
+            l.Font = ChangeFontSizePt(l.Font, fontSize);
+          }
+        }
+        if (togglePreviewCheckBox.Checked) UpdatePreview();
+      }
+    }
+
+    private void numericComboBox_Validating(object sender, CancelEventArgs e) {
+      if (!(sender is ComboBox)) return;
       float number;
-      e.Cancel = !float.TryParse(scalesComboBox.Text, out number);
+      e.Cancel = !float.TryParse((sender as ComboBox).Text, out number);
     }
 
@@ -281,13 +320,10 @@
 
     private void okButton_Click(object sender, EventArgs e) {
-      float dpi = float.Parse(resolutionComboBox.Text);
-      if (resolutionUnitComboBox.SelectedIndex == 1) dpi *= CMPERINCH;
-      float width = (float)widthNumericUD.Value;
-      float height = (float)heightNumericUD.Value;
-      if (lengthUnitComboBox.SelectedIndex == 1) {
-        width /= CMPERINCH;
-        height /= CMPERINCH;
-      }
-      Bitmap image = new Bitmap((int)Math.Round(width * dpi), (int)Math.Round(height * dpi));
+      float dpi;
+      float width;
+      float height;
+      GetImageParameters(out dpi, out width, out height);
+
+      Bitmap image = new Bitmap((int)Math.Round(width), (int)Math.Round(height));
       image.SetResolution(dpi, dpi);
       using (Graphics graphics = Graphics.FromImage(image)) {
@@ -295,4 +331,5 @@
       }
 
+      if (titleTextBox.Text.Trim() != String.Empty) saveFileDialog.FileName = titleTextBox.Text.Trim();
       if (saveFileDialog.ShowDialog() == DialogResult.OK) {
         ImageFormat format = ImageFormat.Bmp;
