+ int hotSpotX = image.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_X);
+ int hotSpotY = image.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_Y);
+#if wxMAC_USE_COCOA
+ wxBitmap bmp( image );
+ CGImageRef cgimage = wxMacCreateCGImageFromBitmap(bmp);
+ if ( cgimage )
+ {
+ M_CURSORDATA->m_hCursor = wxMacCocoaCreateCursorFromCGImage( cgimage, hotSpotX, hotSpotY );
+ CFRelease( cgimage );
+ }
+#else
+#ifndef __LP64__
+ int w = 16;
+ int h = 16;
+
+ int image_w = image.GetWidth();
+ int image_h = image.GetHeight();
+
+ wxASSERT_MSG( hotSpotX >= 0 && hotSpotX < image_w &&
+ hotSpotY >= 0 && hotSpotY < image_h,
+ wxT("invalid cursor hot spot coordinates") );
+
+ wxImage image16(image); // final image of correct size
+
+ // if image is too small then place it in the center, resize it if too big
+ if ((w > image_w) && (h > image_h))
+ {
+ wxPoint offset((w - image_w) / 2, (h - image_h) / 2);
+ hotSpotX = hotSpotX + offset.x;
+ hotSpotY = hotSpotY + offset.y;