Sicherung

This commit is contained in:
Maier Stephan SI
2023-04-17 07:07:49 +02:00
parent f3f89b94f5
commit 1c68b8f401
1307 changed files with 7918 additions and 82491 deletions

View 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;
}
}
}