Re: Render Text to Pixbuf



Here a similar work with PyGTK:
http://www.nabble.com/Draw-text-over-image-ts18391145.html

And my PyGTK code tha works:

pixbuf = gtk.gdk.pixbuf_new_from_file('bx-green.png')
drawable = pixbuf.render_pixmap_and_mask(alpha_threshold=127)[0]
textLay = self.dialog.create_pango_layout(numLocal(ddate[2]))
(w, h) = textLay.get_pixel_size()
drawable.draw_layout(drawable.new_gc(), (22-w)/2.0, 5+(19-h)/2.0, textLay,
None, None)
self.trayPix.get_from_drawable(drawable,
self.dialog.get_screen().get_system_colormap(), 0, 0, 0, 0, -1, -1)
self.statusIcon.set_from_pixbuf(self.trayPix)
-- 
View this message in context: http://www.nabble.com/Render-Text-to-Pixbuf-tp10259345p23896745.html
Sent from the Gtkmm mailing list archive at Nabble.com.



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