[gnome-print] pixbuf printing
- From: Harsha Kodnad <kmharsha yahoo com>
- To: gnome-print miling list <gnome-print ximian com>
- Cc: GnomeDevel Mailing List <gnome-devel-list gnome org>
- Subject: [gnome-print] pixbuf printing
- Date: Tue, 2 Apr 2002 20:23:44 -0800 (PST)
Hello,
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
quality.
gnome_print_scale ( pc, widthDest, heightDest );
gnome_print_pixbuf ( pc, pixbuf );
gnome_print_grestore ( pc );
gdk_pixbuf_unref ( pixbuf );
return;
}
=====
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]