I want to draw an image on a window using Cairo. How can I load a bmp or png from disk and create a brush from it?
The code below shows where drawing should be made. The expose signal is attached to the window.
gboolean OnExpose(GtkWidget *widget, GdkEventExpose *event, gpointer data)
{
cairo_t *cr;
cr = gdk_cairo_create(widget->window);
//Draw bitmap on cr by
//loading background.png
cairo_destroy(cr);
return TRUE;
}