diff options
author | Jean-Francois Mauguit <jfmauguit@mac.com> | 2024-09-24 09:03:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 09:03:25 -0400 |
commit | bab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Winamp/dpi.h | |
parent | 4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff) | |
parent | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff) | |
download | winamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz |
Merge pull request #5 from WinampDesktop/community
Merge to main
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 |