Re: transparent window



Actually, what I thought the problem is:

"tarea->mask" is a bitmap with depth 1.
However, the "src" is a pixmap with depth more than 1.
But the "bitmap_gc" only supports depth 1, which means the graphic context cannot
figure out how to
draw the "src" to the "tarea->mask",  this causes the problem.

Even if you change the bitmap_gc to support the depth of "src", then, because the
"tarea->mask" is with depth 1, so that you still
cannot draw on that either, it will give the same error messages ( I have tried
that ).
So, I think the point is when you call gdk_draw_pixmap(...), the depth of "src",
"dest" and "gc" must match together.

To solve this problem
What I changed is to draw and fill a rectangle which use the front color of the
bitmap_gc, then it does not need to require the depth.

Jiang


Paul Barton-Davis wrote:

> >I think I figure out what is wrong:
> >
> >For the drawing Pixmap, because the depth of the pixmap may not be 1, so that,
> >if you use
> >    gdk_draw_pixmap (tarea->mask, tarea->bitmap_gc, src, xsrc, ysrc, xdest, yd
> >est,
> >width, height);
> >in the function
> >   gtk_transparency_draw_pixmap(...).
> >Because the bitmap_gc only supports depth 1, and the src, which is the pixmap
> >may
> >have depth more than 1;
> >if this happened, then it will cause problem.
> >
> >To fix this problem, only need to simply
> >Change :
> >    gdk_draw_pixmap (tarea->mask, tarea->bitmap_gc, src, xsrc, ysrc, xdest, yd
> >est,
> >width, height);
> >in the gtk_transparency_draw_pixmap(...)
> >To:
> >    gdk_draw_rectangle( tarea->mask, tarea->bitmap_gc, true, xdest, ydest, wid
> >th,
> >height );
> >
> >I tryed this and it works perfect.
>
> Sounds good. Except:
>
>        tarea->mask
>
> *is* a BITMAP (i.e. a pixmap with depth 1). so if you've found a
> situation in which the mask does not have depth 1, you've found a
> bug. how do you think you ended up with a depth != 1 ?
>
> --p
>
> _______________________________________________
> gtk-list mailing list
> gtk-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-list





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