[pygtk] PyGTK + Cairo + PNG file in the background

2009-09-11 Thread Fabrice DELENTE
Hello. I'm trying to develop a small app to do the following: I'd like to have a PNG file loaded in the background, rescaled to the width of my window, with a vertical scroller; I want to be able to click on the PNG and type text at the point where I clicked. I intend to use pangocairo to type

Re: [pygtk] PyGTK + Cairo + PNG file in the background

2009-09-11 Thread David Ripton
On 2009.09.11 18:10:02 +0200, Fabrice DELENTE wrote: I'm trying to develop a small app to do the following: I'd like to have a PNG file loaded in the background, rescaled to the width of my window, with a vertical scroller; I want to be able to click on the PNG and type text at the point

Re: [pygtk] PyGTK + Cairo + PNG file in the background

2009-09-11 Thread Fabrice DELENTE
Here are a couple of lines to get you started: surface = cairo.ImageSurface.create_from_png(path) ctx = cairo.Context(surface) Thanks! If I understand correctly, I can then draw on ctk using move_to, line_to and paint? Another thing: is there a way to scale down an image using cairo, or do