Re: Rendering GdkRGB to a 1-bpp pixmap (display)



Michael Torrie <torriem cs byu edu> writes:

> I'm writing a simple app that works on a 1-bpp X display.  I know gtk
> isn't really designed to look good on 1-bpp, but it works well enough
> for what I need.   The problem is that if I render either a GdkRGB image
> or GdkPixbuf image to a window (drawable), the image gets dithered
> properly, but it's inverted.  The lights are dark and vice versa.  Is
> this a "bug" in gtk or is it a problem with the X server (besides being
> 1-bpp ;)?  I could simply invert all the colors when I put them in the
> buffer, but then it wouldn't look good on a normal 24-bpp display.
> 
> I'm using gtk+-2 (as shipped on redhat 8) and displaying on a
> Sparcstation ELC.  I don't use any gui elements at this stage; only the
> GtkDrawable in a window.
> 
> Any ideas?  Thanks so much.

Looks like a GTK+ bug. With a brief glance it looks like 
gdk/gdkrgb.c:gdk_rgb_convert_1() assumes that 1 == white, 
0 == black, but if I'm not mistaken, 1bpp displays can be 
either way in X.

File a bug :-) /usr/share/doc/gtk2-VERSION/README has 
instructions.

Regards,
                                        Owen



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]