Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/20/11 17:07:01 (12 years ago)
Author:
abeham
Message:

#1603

  • Made display name change transparent
  • Changed ok button

#1611

  • added warning and added label to show image size
  • fixed controls resizing
Location:
trunk/sources/HeuristicLab.Visualization.ChartControlsExtensions/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Visualization.ChartControlsExtensions/3.3/ImageExportDialog.Designer.cs

    r6641 r7216  
    6767      this.previewZoomLabel = new System.Windows.Forms.Label();
    6868      this.saveFileDialog = new System.Windows.Forms.SaveFileDialog();
     69      this.label19 = new System.Windows.Forms.Label();
     70      this.rawImageSizeLabel = new System.Windows.Forms.Label();
    6971      ((System.ComponentModel.ISupportInitialize)(this.widthNumericUD)).BeginInit();
    7072      this.groupBox1.SuspendLayout();
     
    162164            "96",
    163165            "150",
    164             "300",
    165             "600"});
     166            "300"});
    166167      this.resolutionComboBox.Location = new System.Drawing.Point(76, 383);
    167168      this.resolutionComboBox.Name = "resolutionComboBox";
     
    180181            65536});
    181182      this.widthNumericUD.Location = new System.Drawing.Point(76, 410);
    182       this.widthNumericUD.Maximum = new decimal(new int[] {
    183             1000,
    184             0,
    185             0,
    186             0});
    187183      this.widthNumericUD.Minimum = new decimal(new int[] {
    188184            1,
    189185            0,
    190186            0,
    191             131072});
     187            65536});
    192188      this.widthNumericUD.Name = "widthNumericUD";
    193189      this.widthNumericUD.Size = new System.Drawing.Size(75, 20);
     
    499495            65536});
    500496      this.heightNumericUD.Location = new System.Drawing.Point(76, 436);
    501       this.heightNumericUD.Maximum = new decimal(new int[] {
    502             1000,
    503             0,
    504             0,
    505             0});
    506497      this.heightNumericUD.Minimum = new decimal(new int[] {
    507498            1,
    508499            0,
    509500            0,
    510             131072});
     501            65536});
    511502      this.heightNumericUD.Name = "heightNumericUD";
    512503      this.heightNumericUD.Size = new System.Drawing.Size(75, 20);
     
    548539      //
    549540      this.splitContainer.Panel2.Controls.Add(this.previewPictureBox);
     541      this.splitContainer.Panel2.Controls.Add(this.label19);
    550542      this.splitContainer.Panel2.Controls.Add(this.label13);
     543      this.splitContainer.Panel2.Controls.Add(this.rawImageSizeLabel);
    551544      this.splitContainer.Panel2.Controls.Add(this.previewZoomLabel);
    552545      this.splitContainer.Size = new System.Drawing.Size(793, 478);
     
    640633          "*.gif)|*.gif|TIFF (*.tif)|*.tif\"";
    641634      this.saveFileDialog.FilterIndex = 2;
     635      //
     636      // label19
     637      //
     638      this.label19.AutoSize = true;
     639      this.label19.Location = new System.Drawing.Point(85, 459);
     640      this.label19.Name = "label19";
     641      this.label19.Size = new System.Drawing.Size(84, 13);
     642      this.label19.TabIndex = 10;
     643      this.label19.Text = "Raw image size:";
     644      //
     645      // rawImageSizeLabel
     646      //
     647      this.rawImageSizeLabel.AutoSize = true;
     648      this.rawImageSizeLabel.Location = new System.Drawing.Point(175, 459);
     649      this.rawImageSizeLabel.Name = "rawImageSizeLabel";
     650      this.rawImageSizeLabel.Size = new System.Drawing.Size(37, 13);
     651      this.rawImageSizeLabel.TabIndex = 10;
     652      this.rawImageSizeLabel.Text = "0.00M";
    642653      //
    643654      // ImageExportDialog
     
    721732    private System.Windows.Forms.ComboBox legendFontSizeComboBox;
    722733    private System.Windows.Forms.Label label17;
     734    private System.Windows.Forms.Label label19;
     735    private System.Windows.Forms.Label rawImageSizeLabel;
    723736  }
    724737}
  • trunk/sources/HeuristicLab.Visualization.ChartControlsExtensions/3.3/ImageExportDialog.cs

    r6644 r7216  
    127127        previewHeight = (int)Math.Round(height);
    128128      } else previewZoomLabel.Text = (scaleFactor * 100).ToString("0") + "%";
     129      rawImageSizeLabel.Text = GetRawImageSizeInMegabytes(width, height).ToString("0.00") + "M   " + "(" + Math.Round(width).ToString("0") + " x " + Math.Round(height).ToString("0") + ") pixels";
    129130
    130131      Bitmap image = new Bitmap(previewWidth, previewHeight);
     
    238239
    239240    private void widthNumericUD_ValueChanged(object sender, EventArgs e) {
     241      float dpi, width, height;
     242      GetImageParameters(out dpi, out width, out height);
     243      if (GetRawImageSizeInMegabytes(width, height) > 25) // bigger than A4 at 300dpi
     244        MessageBox.Show("Warning: The image is getting quite big.");
    240245      if (togglePreviewCheckBox.Checked) UpdatePreview();
    241246    }
    242247
    243248    private void heightNumericUD_ValueChanged(object sender, EventArgs e) {
     249      float dpi, width, height;
     250      GetImageParameters(out dpi, out width, out height);
     251      if (GetRawImageSizeInMegabytes(width, height) > 25) // bigger than A4 at 300dpi
     252        MessageBox.Show("Warning: The image is getting quite big.");
    244253      if (togglePreviewCheckBox.Checked) UpdatePreview();
    245254    }
     
    376385    }
    377386
     387    private static float GetRawImageSizeInMegabytes(float width, float height) {
     388      return ((3 * width * height) / (1024 * 1024));
     389    }
     390
    378391  }
    379392}
Note: See TracChangeset for help on using the changeset viewer.