Skip to content

Instantly share code, notes, and snippets.

@onlyshk
Created July 19, 2010 13:59
Show Gist options
  • Save onlyshk/481442 to your computer and use it in GitHub Desktop.
Save onlyshk/481442 to your computer and use it in GitHub Desktop.
static void draw_page (GtkPrintOperation * oper, GtkPrintContext * context,
gint nr, gpointer user_data)
{
GList* list;
int n = g_list_length (list);
MainWin* mw = (MainWin*)user_data;
GdkPixbuf* pixbuf = gdk_pixbuf_new_from_file(image_list_get_current_file_path (mw->img_list),NULL);
pixbuf = gdk_pixbuf_scale_simple (pixbuf,
197, 210,
GDK_INTERP_HYPER);
cairo_t *cr = gtk_print_context_get_cairo_context (context);
cairo_surface_t *image;
gdk_cairo_set_source_pixbuf(cr, pixbuf, 0, 0);
cairo_paint (cr);
cairo_surface_destroy (image);
g_object_unref (pixbuf);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment