v1.2
This commit is contained in:
31
FSI.BT.Tools/Global/Utilities/Scaling.cs
Normal file
31
FSI.BT.Tools/Global/Utilities/Scaling.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
// <copyright file="Scaling.cs" company="PlaceholderCompany">
|
||||
// Copyright (c) PlaceholderCompany. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace FSI.BT.Tools.Global.Utilities
|
||||
{
|
||||
using System;
|
||||
using System.Drawing;
|
||||
|
||||
internal static class Scaling
|
||||
{
|
||||
public static float Factor { get; private set; } = 1;
|
||||
|
||||
public static float FactorByDpi { get; private set; } = 1;
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
Factor = Global.Vars.SystemTrayMenuSettings.SizeInPercent / 100f;
|
||||
}
|
||||
|
||||
public static int Scale(int width)
|
||||
{
|
||||
return (int)Math.Round(width * Factor, 0, MidpointRounding.AwayFromZero);
|
||||
}
|
||||
|
||||
public static void CalculateFactorByDpi(Graphics graphics)
|
||||
{
|
||||
FactorByDpi = graphics.DpiX / 96;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user