MCPcopy Create free account
hub / github.com/Aleksoid1978/VideoRenderer / UpdateStatsByDisplay

Method UpdateStatsByDisplay

Source/VideoProcessor.cpp:76–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74 CalcStatsParams(); // always run here to recalculate the graph position
75}
76void CVideoProcessor::UpdateStatsByDisplay()
77{
78 if (m_iResizeStats == 0) {
79 int dpiH = 0;
80
81 if (IsWindows8OrGreater()) {
82 static HMODULE hShcore = LoadLibraryW(L"Shcore.dll");
83 if (hShcore) {
84 typedef HRESULT(WINAPI* tpGetDpiForMonitor)(HMONITOR hmonitor, MONITOR_DPI_TYPE dpiType, UINT* dpiX, UINT* dpiY);
85 static tpGetDpiForMonitor pGetDpiForMonitor = (tpGetDpiForMonitor)GetProcAddress(hShcore, "GetDpiForMonitor");
86 if (pGetDpiForMonitor) {
87 UINT dpix, dpiy;
88 if (S_OK == pGetDpiForMonitor(MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST), MDT_EFFECTIVE_DPI, &dpix, &dpiy)) {
89 dpiH = dpiy;
90 }
91 }
92 }
93 }
94
95 if (!dpiH) {
96 HDC hdc = GetDC(nullptr);
97 if (hdc) {
98 dpiH = GetDeviceCaps(hdc, LOGPIXELSY);
99 ReleaseDC(nullptr, hdc);
100 }
101 else {
102 dpiH = 14;
103 }
104 }
105
106 m_StatsFontH = MulDiv(14, dpiH, 96);
107
108 CalcStatsParams();
109 }
110}
111
112bool CVideoProcessor::CheckGraphPlacement()
113{

Callers 1

OnWindowMoveMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected