Re: Copying pixmap into another




"David M. Cook" <davecook@hotmail.com> writes:

> I was playing with the scribble demo and noticed that it didn't redraw
> when the window is resized.  I'd like to fix this by copying the old
> backing pixmap into the new backing pixmap.  Is there a gtk function
> for this?  Or perhaps a better way to redraw on a resize?

To copy one pixmap to another, you use the same function as
you would to copy a pixmap onto the screen - gdk_draw_pixmap.

So, in this case, it would look something like:

  gint width, height;

  gdk_window_get_size (old_pixmap, &width, &height);
  gdk_draw_pixmap (new_pixmap, widget->style->white_gc, old_pixmap,
                   0, 0, 0, 0, width, height);

Regards,
                                        Owen



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