[gnome-print] printing GdkPixbuf and GdkPixmap



Hello everybody,
 
I have a GdkPixmap with some text. Now I want to print
it on GnomePrintContext by scaling it down.
I am creating a GdkPixbuf from the pixmap and scaling
the pixmap and printing it,
but It is loosing quality. If I use the GdkPixbuf
scaling the output on the GnomePrintContext becomes
blur
If I use the gnome-print scaling function It loosing
quality the fallowing code shows what I am doing 
can anybody help me ?
 
void PrintStretchedText ( GnomePrintContext * context,
GdkPixmap *pixmap, int xSrc, int ySrc, int widthSrc,
int heightSrc, int widthDest, int heightDest ) 
{
    GdkPixbuf    pbsrc, pbscaled;
 
    pbsrc = gdk_pixbuf_get_from_drawable ( NULL, src,
cmap, xSrc, ySrc, 0, 0, widthSrc, heightSrc );
    pbscaled = gdk_pixbuf_scale_simple ( pbsrc,
widthDest, heightDest, GDK_INTERP_HYPER );
    gnome_print_gsave ( context );
    gnome_print_translate ( context, xDest, yDest );
    gnome_print_scale ( context, widthDest, heightDest
);
    gnome_print_pixbuf ( context, pbscaled );
    gdk_pixbuf_unref ( pbsrc );
    gdk_pixbuf_unref ( pbscaled );
}
 

Thanks in advance,

Regards


=====
Harsha Kodnad

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/




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