Re: Render Text to Pixbuf
- From: Daniel Elstner <daniel kitta googlemail com>
- To: Jonathon Jongsma <jonathon jongsma gmail com>
- Cc: Paul Davis <pjdavis engineering uiowa edu>, gtkmm-list <gtkmm-list gnome org>
- Subject: Re: Render Text to Pixbuf
- Date: Mon, 08 Jun 2009 09:41:39 +0200
Am Dienstag, den 01.05.2007, 10:10 -0500 schrieb Jonathon Jongsma:
> > I managed to get a not so good method working. I create a scratch
> > cairo context using Cairo's image surface. Then I just use cairo to
> > draw to this offscreen buffer and copy it onto my pixbuf where it
> > goes. Copying from the surface to the pixbuf causes some artefacts
> > around the edges of the text due to smoothing, but its good enough for
> > now unless someone has a better idea.
> too bad. I was hoping my quick-and-easy idea would work, but it looks
> like the formats aren't compatible enough to make it easy... I guess
> if I were you, I'd ask on a gtk or cairo mailing list as I'm sure
> somebody has wanted to do this before. Maybe somebody there knows a
> clever way to do it.
I'd say avoid Gdk::Pixbuf if you can, and use Cairo only. If you can't,
it's probably cleaner to convert the pixbuf to a Cairo image surface and
then back, rather the empty surface plus merge approach you described.
I doubt that it will be significantly slower.
] [Thread Prev