Re: pygtk: transparent pixmaps



Hallo,
On Wed, Jun 07, 2006 at 11:54:42AM +0200, David Nečas (Yeti) wrote:
On Wed, Jun 07, 2006 at 11:36:35AM +0200, Jachym Cepicky wrote:
I try to script some app. using pygtk. One of the tasks is to draw some
data on the image background. I would like to use approach like follows:

    pixbuf =  gtk.gdk.pixbuf_new_from_file("tmp.ppm")
    pixmap = gtk.gdk.Pixmap(widget.window, width, height)

    for line in lines:
        pixmap.draw_line(line[x], line[y]...)

    drawingarea.window.draw_pixbuf(...,pixbuf,0,0,0,0,.....)
    drawingarea.window.draw_drawable(..., pixmap, ....)

Result is, the background image (pixbuf) appears, but only shortly, than
it is overlaid by *black* (non-transparent) pixmap.

So my question: How to perform task like this with python?

Scrap the pixmap and just draw the lines on
drawingarea.window (after the pixbuf, of course)?

Yeti


The point is, I want to move my app. from this way. There can be
thousends of lines (vector map) and the drawing area has to be redrawed
everytime some other window (or just tooltip) overlaps it - and it takes
time :-(

So I thought, I will just redraw prepared pixmap and redraw everything
only if region of the map will change (zoom/pan).

Thanks for your tip anyway

Jachym

P.S.: Nečekal jsem Tě tady, doufám, že život jde dobře.

-- 
Jachym Cepicky
e-mail: jachym cepicky centrum cz
URL: http://les-ejk.cz
GPG: http://les-ejk.cz/gnupg_public_key/jachym_cepicky-gpg_public_key.asc
-----------------------------------------   
OFFICE:                                     
GDF-Hannover
Mengendamm 16d
30177 Hannover
Germany
e-mail: cepicky gdf-hannover de
URL:    http://gdf-hannover.de
Tel.:   +49 511-39088507


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