In my pygps application, I've got a map that moves as you walk around
with your GPS connected to your laptop or (in my case) Linux iPAQ.
But I'm having a really weird problem.  I do this to load the map:

    img = GdkImlib.Image("maps/"+world[8])

and I save it in a global variable.  Then, later, I do this:

        img.render() 
        pix, mask = img.get_pixmap()
        print img, pix, mask
        win = mapd.get_window()
        if win:
            # draw the map on the pixmap.
            # if this map does not completely cover the screen, we might want to
            # draw another map next to this one.
            draw_pixmap(map_pixmap, mapd.get_style().white_gc, pix,
                        current_map_center[0] - win.width/2, current_map_center[1] - 
win.height/2,
                        0,0, win.width,win.height)

See that print statement?  When the program works, it prints this:

    <GdkImlib.Image instance at 8104328> <GdkPixmap at 817a230> None

If I move the img.render() call immediately after I load the map, it
prints this:

    <GdkImlib.Image instance at 813c340> <GdkWindow at 0> None

Is there anything I can do about this?  Obviously I can't draw a
Pixmap using a Window, so the draw_pixmap() fails.  I'd really prefer
to leave the image rendered so I can scribble the user's movements on
the pixmap in the form of an arrow.  Also, I'd like to be able to zoom
in or out, so I'll render the pixmap twice or half size.  That's an
expensive operation, so I'd like to only do it once.

-- 
-russ nelson <[EMAIL PROTECTED]>  http://russnelson.com
Crynwr sells support for free software  | PGPok | 
521 Pleasant Valley Rd. | +1 315 268 1925 voice | #exclude <windows.h>
Potsdam, NY 13676-3213  | +1 315 268 9201 FAX   | 
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to