mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
.NET 4.5 scales toolstrips for us
This commit is contained in:
parent
c60467ee3b
commit
52a15de904
2 changed files with 0 additions and 26 deletions
|
@ -100,19 +100,6 @@ internal void CreateToolbar()
|
|||
|
||||
tsMain.SuspendLayout();
|
||||
|
||||
// https://www.medo64.com/2014/01/scaling-toolstrip-with-dpi/
|
||||
using (Graphics g = menuForm.CreateGraphics())
|
||||
{
|
||||
double scale = Math.Max(g.DpiX, g.DpiY) / 96.0;
|
||||
double newScale = ((int)Math.Floor(scale * 100) / 25 * 25) / 100.0;
|
||||
if (newScale > 1)
|
||||
{
|
||||
int newWidth = (int)(tsMain.ImageScalingSize.Width * newScale);
|
||||
int newHeight = (int)(tsMain.ImageScalingSize.Height * newScale);
|
||||
tsMain.ImageScalingSize = new Size(newWidth, newHeight);
|
||||
}
|
||||
}
|
||||
|
||||
menuForm.Controls.Add(tsMain);
|
||||
|
||||
if (Form.IsFullscreen)
|
||||
|
|
|
@ -101,19 +101,6 @@ private void InitializeComponent()
|
|||
ShowItemToolTips = false
|
||||
};
|
||||
|
||||
// https://www.medo64.com/2014/01/scaling-toolstrip-with-dpi/
|
||||
using (Graphics g = CreateGraphics())
|
||||
{
|
||||
double scale = Math.Max(g.DpiX, g.DpiY) / 96.0;
|
||||
double newScale = ((int)Math.Floor(scale * 100) / 25 * 25) / 100.0;
|
||||
if (newScale > 1)
|
||||
{
|
||||
int newWidth = (int)(tsMain.ImageScalingSize.Width * newScale);
|
||||
int newHeight = (int)(tsMain.ImageScalingSize.Height * newScale);
|
||||
tsMain.ImageScalingSize = new Size(newWidth, newHeight);
|
||||
}
|
||||
}
|
||||
|
||||
tsMain.MouseLeave += tsMain_MouseLeave;
|
||||
|
||||
Controls.Add(tsMain);
|
||||
|
|
Loading…
Reference in a new issue