diff options
Diffstat (limited to 'Src/Winamp/dpi.h')
-rw-r--r-- | Src/Winamp/dpi.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/Src/Winamp/dpi.h b/Src/Winamp/dpi.h new file mode 100644 index 00000000..e657240d --- /dev/null +++ b/Src/Winamp/dpi.h @@ -0,0 +1,46 @@ +#pragma once +/*#ifndef _WA_DPI_H +#define _WA_DPI_H*/ + +#ifdef __cplusplus + +extern "C" +{ +#endif + +#include <windows.h> + +// DPI awareness based on http://msdn.microsoft.com/en-US/library/dd464660.aspx +// Definition: relative pixel = 1 pixel at 96 DPI and scaled based on actual DPI. + +// Get screen DPI. +int GetDPIX(); +int GetDPIY(); + +// Convert between raw pixels and relative pixels. +int ScaleX(int x); +int ScaleY(int y); +int UnscaleX(int x); +int UnscaleY(int y); + +int _ScaledSystemMetricX(int nIndex); +int _ScaledSystemMetricY(int nIndex); + +// Determine the screen dimensions in relative pixels. +int ScaledScreenWidth(); +int ScaledScreenHeight(); + +// Scale rectangle from raw pixels to relative pixels. +void ScaleRect(__inout RECT *pRect); + +// Determine if screen resolution meets minimum requirements in relative pixels. +BOOL IsResolutionAtLeast(int cxMin, int cyMin); + +// Convert a point size (1/72 of an inch) to raw pixels. +int PointsToPixels(int pt); + +#ifdef __cplusplus +} // extern "C" +#endif + +//#endif
\ No newline at end of file |