The biggest size of Windows Cursor
Asked Answered
A

3

2

I have a cursor what the size size 128x128, but when i used LoadCursor to load and show it, it only has 32x32. Which API can make it correctly? It seems MS resize it. Thanks.

Aleksandropol answered 20/1, 2010 at 10:31 Comment(0)
D
3

Windows XP does not include any system cursors that are larger than 32x32. (If larger cursors were included, they would be stretched down to 32x32 when the standard APIs load the cursors.)

For high-DPI systems, Windows XP has adjusted the SM_CXCURSOR and SM_CYCURSOR values to be 64x64 pixels. This size adjustment is to prevent the mouse pointer from virtually disappearing because it is too small to be effectively used. Although the other aspects of the system scale with DPI, the mouse pointer does not scale. Microsoft does not try to enforce a DPI-independent size for the mouse pointer.

The system also provides the SetSystemCursor API function that you can use to change the system cursor for specific categories. You can use this function to set a cursor of any size. However, you must call the function programmatically, and you can only use it to set a cursor for a specific category. You cannot use it to make all cursors on the system the same size.

http://support.microsoft.com/kb/307213

Dense answered 20/1, 2010 at 10:36 Comment(1)
This is no longer accurate. Windows does scale the OEM cursors with DPI, and there is also a cursor magnification multiplier available in the accessibility settings. Results from the API (and bitmaps produced by LoadCursor/LoadImage) will be scaled to the primary display. If you want to show something correctly on other displays you may have to scale the cursor yourself to match the DPI of the screen you're drawing on.Gemology
C
2

Don't use LoadCursor, use LoadImage() instead.

Costard answered 20/1, 2010 at 11:39 Comment(0)
V
1

SM_CXCURSOR by SM_CYCURSOR is the only cursor size the system can currently use. Use GetSystemMetrics to find out those values.

Vardon answered 20/1, 2010 at 10:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.