Re: [gtk-list] double buffering question




Amit Kumar <amit@usc.edu> writes:

> hi,
> 
> i have a question somewhat related to double buffering (i
> think). basically,i have a GdkPixmap (say 'A') i'm loading from a
> file. i have another GdkPixmap (say 'B') that's the backing pixmap for
> a widget, and is basically 'A' + a rectangle 
> 
> now, each click on the area will change the location of the
> rectangle. hence, i'll redraw the pixmap (assume i can't find the old
> location of the rectangle, otherwise i'd have just repainted it in
> bg), and the rectangle in the new place.
> 
> *now* the gtk question <grin>.
> 
> is there any way of copying/cloning/duplicating a pixmap from another
> one? basically each time i do a redraw, i want to copy 'A' to 'B',
> then draw the rect, and then redisplay.
> 
> since the actual data is in a file, i don't wanna do a create_from_xpm
> each time i redraw! (which i'll have to do if i can't copy from 'A' to
> 'B': loading 'B' from the file each time)
> 
> i guess i can do a memcpy, but i don't know the size of pixmap (i know
> gdk_window_get_geometry is not supported; even that might not give all
> the info to divine the size of the structure).

 - gdk_window_get_size() will work on a pixmap.

 - The way to copy from one pixmap to another is to draw the first
   pixmap on the second using gdk_draw_pixmap()

Regards,
                                        Owen





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