pixbuf printing


I have a GdkPixmap, I am drawing some text on this
pixmap using  gdk_draw_text. Now I want to transfer
this text to GnomePrintContext but, when I transfer it
using fallowing code it is loosing its quality. It
looks horible in printout (and even in preview also)
is there any solutions to improve the quality ???

void PrintStretchedText ( GdkPixmap pixmap,
GdkColorMap cmap, int xSrc, int ySrc, int widthSrc,
int heightSrc, GnomePrintContext pc, INT pageHeight,
xDest, yDest, widthDest, heightDest ) {

GdkPixbuf pixbuf;

//create a pixbuf from pixmap since you can't print
pixmap directly!!!!

pixbuf = gdk_pixbuf_get_from_drawable ( NULL, pixmap,
cmap, xSrc, ySrc, 0, 0, widthSrc, heightSrc );

// print the pixbuf
gnome_print_gsave ( pc );
gnome_print_translate ( pc, xDest, pageHeight - yDest
-heightDest );

// scale the pixbuf to the destination size 
// even if scaling is 1:1 then also it is loosing
gnome_print_scale ( pc, widthDest, heightDest );
gnome_print_pixbuf ( pc, pixbuf );
gnome_print_grestore ( pc );
gdk_pixbuf_unref ( pixbuf );

Harsha Kodnad

Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax

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