GNOME Bugzilla – Bug 119290
GdkImage::mem platform specific ?
Last modified: 2010-08-25 05:47:29 UTC
During the implementation of gdk_window_set_icon() I used the following code (which is disabled in cvs now) : #if 0 /* to debug pixmap and mask setting */ { GdkPixbuf* pixbuf = NULL; char name[256]; pixbuf = gdk_pixbuf_get_from_drawable (NULL, pixmap, NULL, 0, 0, 0, 0, w, h); if (pixbuf) { num = (num + 1) % 999; /* restrict maximim number */ sprintf (name, "c:\\temp\\ico%03dpixm.png", num); gdk_pixbuf_save (pixbuf, name, "png", NULL, NULL); gdk_pixbuf_unref (pixbuf); } pixbuf = !mask ? NULL : gdk_pixbuf_get_from_drawable (NULL, mask, NULL, 0, 0, 0, 0, w, h); if (pixbuf) { sprintf (name, "c:\\temp\\ico%03dmask.png", num); gdk_pixbuf_save (pixbuf, name, "png", NULL, NULL); gdk_pixbuf_unref (pixbuf); } } #endif As far as I can see the GdkImage::mem is shared with the pixmap::bits but for 1bit depth images their representation is different (bits mirrored) This gives the undesired effect shown in attachment one, whereas it should look like attachment two (yes it is Wilber ;-) Any hints how to fix this ?
Created attachment 18973 [details] one : wrong
Created attachment 18974 [details] two : how it shoud look
Does checking GdkImage::byte_order help?
AFAICS it is not an issue of byte (order) _but_ bits. gdk_bitmap_create_from_data() has code to reordering the given data bits, something similar is probably needed elsewhere, too.
That would have to be XImage->bitmap_bit_order, but GdkImage doesn't seem to have that field.
GdkImage has been removed in GTK3