- 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)