- wxImage image16 = image.Scale(16,16) ;
- unsigned char * rgbBits = image16.GetData();
+ int w = 16;
+ int h = 16;
+
+ int hotSpotX = image.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_X);
+ int hotSpotY = image.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_Y);
+ int image_w = image.GetWidth();
+ int image_h = image.GetHeight();
+
+ wxASSERT_MSG( hotSpotX >= 0 && hotSpotX < image_w &&
+ hotSpotY >= 0 && hotSpotY < image_h,
+ _T("invalid cursor hot spot coordinates") );
+
+ wxImage image16(image); // final image of correct size