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



I bet it shows you very tiny dot, where you expect your graphic to be
;) Images are always painted into rectangle (0,0 - 1,1) in current
coordinates.

Necessary chemistry should be:

gnome_print_gsave (pc);
gnome_print_moveto (pc, 200.0, 200.0);
gnome_print_scale (pc, width, height);
do_your_image_printing_here
gnome_print_grestore (pc);

Lauris

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

> Well i have something like that, but gnome_print show me nothing. This
> is my code after aplying your patch:
> 
>   gnome_print_moveto(pc, 200, 200);
>   /*  gnome_print_newpath(pc);*/ /* I don't know if this would be
> useful, but i test it and does not work */
>   logo = gdk_pixbuf_new_from_file
> ("/usr/share/pixmaps/hispafuentes/logo3.png");
>   if (gdk_pixbuf_get_has_alpha (logo)) {
>         gnome_print_rgbaimage (pc,
>                 gdk_pixbuf_get_pixels (logo),
>                 gdk_pixbuf_get_width (logo),
>                 gdk_pixbuf_get_height (logo),
>                 gdk_pixbuf_get_rowstride (logo));
>   } else {
>     gnome_print_rgbimage(pc,
>                 gdk_pixbuf_get_pixels (logo),
>                 gdk_pixbuf_get_width (logo),
>                 gdk_pixbuf_get_height (logo),
>                 gdk_pixbuf_get_rowstride (logo));
>   }
>   /*  gnome_print_closepath(pc);*/
>   gnome_print_stroke(pc);
> 
> Then i close the page and show it, but it only show me the text i have
> showed before.
> 
> Some idea?
> 
> > 
> > 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.
> > 
> 
> Well, i only want show a logo.
> 
> > Lauris
> 
> 





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