Re: GdkPixmap bugs
- From: Ron Steinke <rsteinke w-link net>
- To: otaylor redhat com, rsteinke w-link net
- Cc: gtk-devel-list gnome org
- Subject: Re: GdkPixmap bugs
- Date: Mon, 16 Jul 2001 16:21:52 -0700
> From: Owen Taylor <otaylor redhat com>
>
> Ron Steinke <rsteinke w-link net> writes:
>
> > > From: Owen Taylor <otaylor redhat com>
> > >
> > > And the colormap handling in gdk_pixmap_new() needs special-casing
> > > for the case where the depth of the window is not the
> > > same as the depth of the new pixmap. In the case where
> > > depth == 1, we may be able to supply a proper default colormap,
> >
> > How would you go about creating a GdkVisual of depth 1?
>
> Thinking about it before ... my comment is really nonsensical.
>
> The right thing to do when creating a pixmap where the depth of the
> pixmap doesn't match the depth of the supplied window (or the root
> window, if window is passed in as NULL), is always to leave the
> colormap unset.
>
>
> You can't actual "create" a visual - the set of visuals is fixed.
>
> X's model is actually a little bizarre - you can create pixmaps of
> depths for which there is no corresponding visual and colormap. (The
> list of allowed depths for a screen can be retrieved with
> XListDepths(), something not exposed through GTK+)
>
> The uses of this are:
>
> - For traditional X rendering, depth 1 bitmaps for masks,
> XCopyPlane, etc.
>
> - For the Xrender extensions, alpha masks, 24 bit images offscreen
> images, etc.
So what is the correct Gdk way of doing things like:
reading the bitmap data, a la gdk_get_image()
setting the foreground color of the bitmap graphics context
so that you can use the drawing routines, e.g. gdk_draw_polygon()
Ron
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]