Load cursor with certain resolution

时光怂恿深爱的人放手 提交于 2019-12-10 23:28:55

问题


I have two cursor resources. The first one [IDC_CURSOR1] contains three different image types:

  • 32x32, 24 bpp
  • 48x48, 24 bpp
  • 64x64, 24 bpp

The second one [IDC_CURSOR2] contains only one:

  • 48x48, 24 bpp

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.

How can I load a cursor with other than 32x32 resolution?

BTW: I tried to change DPI because according to msdn it should automatically load higher resolution cursor in higher dpi, but it doesn't.

Thank you!


回答1:


Call LoadImage passing IMAGE_CURSOR and specifying the desired dimensions.

Cursor = (HCURSOR)LoadImage(hinst, IDC_CURSOR1, IMAGE_CURSOR, 64, 64, LR_DEFAULTCOLOR);


来源:https://stackoverflow.com/questions/37916308/load-cursor-with-certain-resolution

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!