[Mono-list] How to draw a text string to existing photo (gtk#)

Larry Ewing lewing at novell.com
Sat Mar 25 17:07:47 EST 2006

On Sat, 2006-03-25 at 16:42 -0500, Miguel de Icaza wrote:
> Hello,
> > I'm looking for an approach to put some text string to existing jpeg
> > image. Now I can load a photo into Gdk.Pixbuf and I can create
> > Pango.Layout for a text string. So I have my image in a Gdk.Pixbuf and
> > my text string in a Pango.Layout, how can I put those things together to
> > obtain an image with text drawn on it? Any suggestions and sample codes
> > are welcome.
> You could use the System.Drawing API as it has this functionality
> already.
> If you want to stick to gtk# and Pixbufs, you need to render the pixbuf
> into a pixmap which is the only object that you can use to render text
> with Pango.

This reminds me, gtk-sharp needs to wrap the pango_cairo_* functions
from pango 1.10 as soon as possible so that people don't need to
p/invoke when using pango with cairo surfaces (which has big advantages
over the pixmap method).


More information about the Mono-list mailing list