コード例 #1
0
        public static void Initialize()
        {
            ThemeBase.InitializeBase();

            var graphics = System.Drawing.Graphics.FromHwnd(IntPtr.Zero);

            // For the main window, we only support 1x or 2x.
            dialogScaling = graphics.DpiX / 96.0f;

            if (Settings.DpiScaling != 0)
            {
                mainWindowScaling = Settings.DpiScaling / 100.0f;
            }
            else
            {
                mainWindowScaling = (int)(dialogScaling * 4.0f) / 4.0f; // Round to 1/4.
            }
            InitializeFonts();
        }
コード例 #2
0
ファイル: Direct2DTheme.cs プロジェクト: ronchaine/FamiStudio
        public static void Initialize()
        {
            ThemeBase.InitializeBase();

            var graphics = System.Drawing.Graphics.FromHwnd(IntPtr.Zero);

            // For the main window, we only support 1x or 2x.
            dialogScaling = graphics.DpiX / 96.0f;

            if (Settings.DpiScaling != 0)
            {
                mainWindowScaling = Settings.DpiScaling / 100.0f;
            }
            else
            {
                mainWindowScaling = Math.Min(2.0f, (int)(dialogScaling * 2.0f) / 2.0f); // Round to 1/2 (so only 100%, 150% and 200%) are supported.
            }
            InitializeFonts();
        }