Re: [gtk-list] making pictures in memory.

On Sat, 31 Jul 1999, John C Atkeson wrote:
>   I've seen you can put an xpm into a pixmap on creation of the pixmap. 
> Can you reset the pixmap with a new xpm, without having to free and
> re-create the pixmap?

You aren't putting an XPM in a pixmap, what you're doing in this case is
converting an XPM to pixels, placing those in a GdkImage, then drawing the
GdkImage to the pixmap. The easiest way to set it to a new XPM is to just
create a new pixmap and copy it to the old pixmap.
>   What is the concept of GdkImage; can you write to one directly a pixel
> at a time without going through gdk_draw_line, etc.?

You can but it's pretty annoying because you have to allocate the color
for every pixel, etc. It's much much easier to use GdkRGB, gdk/gdkrgb.h.

You may be interested in my second sample book chapter at


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