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



Lauris Kaplinski escribió:
> 
> 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 {
>         gnome_print_rgbimage...
> }


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

-- 
Carlos Perelló Marín
mailto:carlos@hispafuentes.com         Teléfonos:
http://www.HispaFuentes.com            Asistencia:     +34913441383
Hispafuentes S.L.                      Administración: +34913441804
Calle José Lázaro Galdiano, 2 entreplanta A
28036 - Madrid  (España)




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