diff --git a/Greenshot/Configuration/EditorConfiguration.cs b/Greenshot/Configuration/EditorConfiguration.cs index 84380dcbe..7ca0c7df6 100644 --- a/Greenshot/Configuration/EditorConfiguration.cs +++ b/Greenshot/Configuration/EditorConfiguration.cs @@ -54,6 +54,8 @@ namespace Greenshot.Configuration { public bool ReuseEditor; [IniProperty("FreehandSensitivity", Description = "The smaller this number, the less smoothing is used. Decrease for detailed drawing, e.g. when using a pen. Increase for smoother lines. e.g. when you want to draw a smooth line.", DefaultValue = "3")] public int FreehandSensitivity; + [IniProperty("EnableButtonScaling", Description = "Experimental DPI scaling for the buttons", DefaultValue = "false")] + public bool EnableButtonScaling; [IniProperty("SuppressSaveDialogAtClose", Description="Suppressed the 'do you want to save' dialog when closing the editor.", DefaultValue="False")] public bool SuppressSaveDialogAtClose; diff --git a/Greenshot/Forms/ImageEditorForm.Designer.cs b/Greenshot/Forms/ImageEditorForm.Designer.cs index c63fe0db0..887a397a6 100644 --- a/Greenshot/Forms/ImageEditorForm.Designer.cs +++ b/Greenshot/Forms/ImageEditorForm.Designer.cs @@ -202,6 +202,8 @@ namespace Greenshot { // // toolStripContainer1 // + this.toolStripContainer1.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); + this.toolStripContainer1.AutoScaleMode = System.Windows.Forms.AutoScaleMode.DPI; // // toolStripContainer1.BottomToolStripPanel // @@ -1712,6 +1714,21 @@ namespace Greenshot { this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.ClientSize = new System.Drawing.Size(785, 485); + if (editorConfiguration.EnableButtonScaling) { + using (var g = this.CreateGraphics()) { + var scale = System.Math.Max(g.DpiX, g.DpiY) / 96.0; + if (scale > 1) { + var newWidth = (int)(toolStrip1.ImageScalingSize.Width * scale); + var newHeight = (int)(toolStrip1.ImageScalingSize.Height * scale); + toolStrip1.ImageScalingSize = new System.Drawing.Size(newWidth, newHeight); + toolStrip1.AutoSize = false; //because sometime it is needed + newWidth = (int)(toolStrip2.ImageScalingSize.Width * scale); + newHeight = (int)(toolStrip2.ImageScalingSize.Height * scale); + toolStrip2.ImageScalingSize = new System.Drawing.Size(newWidth, newHeight); + toolStrip2.AutoSize = false; //because sometime it is needed + } + } + } this.Controls.Add(this.toolStripContainer1); this.KeyPreview = true; this.LanguageKey = "editor_title";