Re: printing images
Martin Kretzschmar <[email protected]> Wed, 03 Nov 2004 22:06:02 +0100
| Newsgroups | gmane.comp.gnome.print |
|---|---|
| Message-ID | <[email protected]> |
Hi Robert Am Mittwoch, den 03.11.2004, 20:16 +0100 schrieb Robert Roebling: > [...] I'm just trying to print RGB right > now. I use > > gnome_print_moveto( gpc, x,y ); > gnome_print_rgbimage( gpc, (chunk of RGB data), 32, 32, 32*3 ); > > but nothing shows up in the printout. It is > there in the file, but something is wrong. > I've included the PS output for a simple test > file (8Kb is hopefully OK). It shows a few lines > and on page 1 one large rectangle and a small one. > The image should be where the small rectangle is, > but it is not. > I'm aware that this might be an obvious error, > but I don't see it. Maybe the positioning is > outside the visible bounds or the image in > shrunk to zero? It is not shrunk to zero, but gnome_print_rgbimage "Draws RGB color image into unit square (0,0 - 1,1) in current coordinate system." So it's shrunk to one ;) You have to adjust the current transformation matrix (ctm) to transform that square to the size you actually want. Look at libgnomeprint/tests/generate.c (my_draw_image) for example code. But ignore the pixbuf generation code ;). And you could play with the "[1 0 0 1 0 0]cm" in your file, a few lines above the image data, to see how the ctm affects the image. HTH, Martin