Re: [gtk-list] Re: plotting text on a pixmap
- From: Janet Davis <janet one-eyed-alien net>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] Re: plotting text on a pixmap
- Date: Tue, 12 Oct 1999 16:00:08 -0700 (PDT)
On Tue, 12 Oct 1999, John C Atkeson wrote:
>   Along the same lines, is there a way to copy one pixmap to another
> using a "mask", the same as you can with xpm data?  I'm thinking of
> drawing the text offscreen and pasting it as a bitmap to the display; I
> don't want to obliterate nearby images.
The trick is to use the mask aspects of the GdkGC.  Here's a snippet from
my code:
gc = gdk_gc_new( GTK_WIDGET(widget)->window );
gdk_gc_set_clip_mask( gc, mask );
gdk_gc_set_clip_origin( gc, x, y );
gdk_draw_pixmap( drawable,
                 gc,
                 pixmap,
                 0, 0,
                 x, y,
                 -1, -1 );
The GdkGC reference page is at
http://www.gtk.org/rdp/gdk/gdk-graphics-contexts.html.
-- 
Janet Davis
janet@one-eyed-alien.net
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]