MCPcopy Create free account
hub / github.com/TranslucentTB/TranslucentTB / GetDpiScale

Method GetDpiScale

TranslucentTB/uwp/basexamlpagehost.cpp:43–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43float BaseXamlPageHost::GetDpiScale(HMONITOR mon)
44{
45 UINT dpiX, dpiY;
46 if (const HRESULT hr = GetDpiForMonitor(mon, MDT_EFFECTIVE_DPI, &dpiX, &dpiY); SUCCEEDED(hr))
47 {
48 return static_cast<float>(dpiX) / USER_DEFAULT_SCREEN_DPI;
49 }
50 else
51 {
52 HresultHandle(hr, spdlog::level::info, L"Failed to get monitor DPI");
53 return 1.0f;
54 }
55}
56
57void BaseXamlPageHost::CalculateInitialPosition(int &x, int &y, int width, int height, POINT cursor, const RECT &workArea, xaml_startup_position position) noexcept
58{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected