Hi, just joined the mailing list, been using GTK and related projects for a while now. Recently I've been developing a Game Boy emulator that uses GtkDrawingArea and GdkPixbuf to display the game screen.
In addition to the game output I want to also be able to draw text and shapes on the display window, and Cairo seems to be the ideal way to draw shapes. I'm already using Cairo to copy the Pixbuf to the GtkDrawingArea, so that seems like a good sign that Cairo and GdkPixbuf should interact nicely. However, it doesn't look like they should be able to interact at all, as they don't seem to be able to agree on a pixel format: http://developer.gnome.org/gdk-pixbuf/stable/gdk-pixbuf-Image-Data-in-Memory.html#gdk-pixbuf-new-from-data "Currently only RGB images with 8 bits per sample are supported." http://developer.gnome.org/gdk-pixbuf/stable/gdk-pixbuf-The-GdkPixbuf-Structure.html#image-data "p[0] = red; p[1] = green; p[2] = blue; p[3] = alpha;" That seems to suggest that GdkPixbuf supports only RGB (24-bit) and RGBA (32-bit). But... http://www.cairographics.org/manual/cairo-Image-Surfaces.html#cairo-format-t CAIRO_FORMAT_ARGB32 is ARGB ("each pixel is a 32-bit quantity, with alpha in the upper 8 bits..."). CAIRO_FORMAT_RGB24 is xRGB ("each pixel is a 32-bit quantity, with the upper 8 bits unused..."). Neither of those are RGB or RGBA. So, how can Cairo operate on a surface provided by GdkPixbuf? -- Sent from my Game Boy. _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list