问题描述
我有两个游标资源.第一个[IDC_CURSOR1]包含三种不同的图像类型:
I have two cursor resources. The first one [IDC_CURSOR1] contains three different image types:
- 32x32,24 bpp
- 48x48,24 bpp
- 64x64,24 bpp
第二个[IDC_CURSOR2]仅包含一个:
The second one [IDC_CURSOR2] contains only one:
- 48x48,24 bpp
如果我正在调用LoadCursor(hInst,IDC_CURSOR1),它将始终加载32x32版本,而我找不到加载48x48或64x64版本的方法.在第二种情况下,它会加载48x48图标(因为没有其他版本),但会将其缩放到32x32.
If I'm calling LoadCursor(hInst, IDC_CURSOR1) it always loads 32x32 version and I was unable to find the way to load 48x48 or 64x64 version. In second case it loads 48x48 icon (because there is no other version), but it scales it down to 32x32.
如何加载非32x32分辨率的光标?
顺便说一句:我试图更改DPI,因为根据msdn,它应该以较高的dpi自动加载分辨率较高的游标,但事实并非如此.
BTW: I tried to change DPI because according to msdn it should automatically load higher resolution cursor in higher dpi, but it doesn't.
谢谢!
推荐答案
调用LoadImage
并传递IMAGE_CURSOR
并指定所需的尺寸.
Call LoadImage
passing IMAGE_CURSOR
and specifying the desired dimensions.
Cursor = (HCURSOR)LoadImage(hinst, IDC_CURSOR1, IMAGE_CURSOR, 64, 64, LR_DEFAULTCOLOR);
这篇关于以一定的分辨率加载光标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!