- wxBitmap bitmap(image_copy);
- wxASSERT(bitmap.HasPixbuf());
- M_CURSORDATA->m_cursor = gdk_cursor_new_from_pixbuf
- (
- display,
- bitmap.GetPixbuf(),
- hotSpotX, hotSpotY
- );
- return;
- }
-
- unsigned long keyMaskColor = 0;
- GdkPixmap* mask;
- if (bHasMask)
- {
- keyMaskColor = wxImageHistogram::MakeKey(
- image.GetMaskRed(), image.GetMaskGreen(), image.GetMaskBlue());
- // get mask before image is modified
- wxBitmap bitmap(image, 1);
- mask = bitmap.GetMask()->GetBitmap();
- g_object_ref(mask);
- }
- else
- {
- const int size = ((w + 7) / 8) * h;
- char* bits = new char[size];
- memset(bits, 0xff, size);
- mask = gdk_bitmap_create_from_data(
- wxGetRootWindow()->window, bits, w, h);
- delete[] bits;
- }
-
- // modify image so wxBitmap can be used to convert to pixmap
- image_copy.SetMask(false);
- int i, j;
- wxByte* data = image_copy.GetData();
- for (j = 0; j < h; j++)
- {
- for (i = 0; i < w; i++, data += 3)
+ GdkPixbuf* pixbuf0 = pixbuf;
+ pixbuf = gdk_pixbuf_add_alpha(pixbuf, hasMask, r, g, b);
+ g_object_unref(pixbuf0);
+ if (alpha)