After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 119290 - GdkImage::mem platform specific ?
GdkImage::mem platform specific ?
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Backend: Win32
2.2.x
Other other
: Normal normal
: Small fix
Assigned To: gtk-win32 maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2003-08-06 21:04 UTC by Hans Breuer
Modified: 2010-08-25 05:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
one : wrong (411 bytes, image/png)
2003-08-06 21:06 UTC, Hans Breuer
Details
two : how it shoud look (410 bytes, image/png)
2003-08-06 21:07 UTC, Hans Breuer
Details

Description Hans Breuer 2003-08-06 21:04:26 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 ?
Comment 1 Hans Breuer 2003-08-06 21:06:12 UTC
Created attachment 18973 [details]
one : wrong
Comment 2 Hans Breuer 2003-08-06 21:07:21 UTC
Created attachment 18974 [details]
two : how it shoud look
Comment 3 Tor Lillqvist 2003-08-07 02:02:45 UTC
Does checking GdkImage::byte_order help?
Comment 4 Hans Breuer 2003-08-07 15:16:59 UTC
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.  
Comment 5 Matthias Clasen 2004-12-23 14:11:16 UTC
That would have to be XImage->bitmap_bit_order, but GdkImage doesn't seem to
have that field.
Comment 6 Matthias Clasen 2010-08-25 05:47:29 UTC
GdkImage has been removed in GTK3