Re: [Gnome-print] What function to print a png file?

On Wed, 7 Jun 2000, Carlos Perelló Marín wrote:

> Hello, i have started to programing with gnome-print, and i can't
> print a png file, well i don't know how do it.
> Some help please?

gpb = gdk_pixbuf_new_from_file (your_file)
if (gdk_pixbuf_has_alpha (gpb) {
	gnome_print_rgbaimage (gpc,
		gdk_pixbuf_get_pixels (gpb),
		gdk_pixbuf_get_width (gpb),
		gdk_pixbuf_get_height (gpb),
		gdk_pixbuf_get_rowstride (gpb));
} else {

The real thing is bit more complicated, as theoretically pixbufs can have
num_channels other than 3, different colorspaces and bits per channel
<> 8. But usually this works.


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