Re: embedding bitmap images into code



Hello !

XPM images [1] may be a solution. In this format, an image is stored as a char array defined in a C header file. You will just need to include that file to get the image embedded in your code.

The problem is that cairo does not provide a way to handle XPM data. You can use Gdk::Pixbuf [2] to load XPM data and then Gdk::Cairo::set_source_pixbuf [3].

[1] http://en.wikipedia.org/wiki/X_PixMap
[2] http://library.gnome.org/devel/gtkmm/stable/classGdk_1_1Pixbuf.html
[3] http://library.gnome.org/devel/gtkmm/stable/namespaceGdk_1_1Cairo.html

Guillaume

Le 06/10/2010 07:28, Igor Gorbounov a écrit :
Hi,
I'm looking for a way of placing bitmap images (for example, PNG-images,
embedded into C++ code as arrays) in a cairo surface.

Any help is needed.

Igor Gorbounov



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