Jump to content
  • Advertisement
Sign in to follow this  
GuitarPlayer0912

Custom cursors stuck at 32x32

This topic is 3983 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I'm trying to change my cursor to a custom one whenever a certain button on a toolbar is clicked. I'm using plain old WinAPI. This is my process. CurTest.rc
MYCUR CURSOR "../Images/MyCur.cur"


CurTest.cpp
#define MYCUR 100

HCURSOR hMyCur = LoadCursor(hInstance, MAKEINTRESOURCE(MYCUR));

// .. rest of program

/* In the WndProc */
switch(msg){
  case WM_SETCURSOR:
    SetCursor(hMyCur);
    return 0;
}


No matter what size I actually make the cursor when I design it, it always comes out as a 32x32 image in my program and it looks really bad. I haven't really used cursors before, so I'm kind of new at this. Anyone have an idea on how to fix this?

Share this post


Link to post
Share on other sites
Advertisement
From MSDN on the subject (from the CreateCursor() reference):

Quote:
The nWidth and nHeight parameters must specify a width and height that are supported by the current display driver, because the system cannot create cursors of other sizes. To determine the width and height supported by the display driver, use the GetSystemMetrics function, specifying the SM_CXCURSOR or SM_CYCURSOR value.


So you can probably only have 32x32 cursors. Bigger is not possible, smaller by having a 32x32 image but the unused areas filled with transparency.

HTH

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!