Re: Can I get the raw array to image data?

1) write generic C functions that are not windows
specific (requiring only a pointer to the first
element and image dimensions to process data)

im not sure if the format in which the data is stored in same format, so
you may need to tweak them for each format.

3) animate the rendering by alternately "blitting"
from the two different sets of array data (i.e., do
animation with double-buffering)

you want to use a GdkPixmap as your double buffer.  to blit to another
drawable surface, use gdk_draw_pixbuf().  generally you will do this
from on pixmap to another or from the pixmap to a window.  the drawable
surface ofa window is part of the widgets struct.

GtkWidget *Win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
GdkPixmap *Pix = gdk_pixmap_new (NULL, 10, 10,

Pix is a drawable and Win->window is a drawable surface.

take a gander at the API docs for Pixmaps and drawing/blitting.

you can make a pixmap from existing data with
gdk_pixmap_create_from_data() or you can grab data from an existing
pixmap using g_object_get_data() (gdk_drawable_get_data() is

the Gtk+ API is split into two parts: GDK for all the drawing and GTK
for all the widgets.  all of while are built on top for GLib, thus the
g_object_xxx_xxx() functions that have replaced some deprecated ones.

check out the fun API documentation here:

good luck.

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