gtk drawing set background image

前端 未结 1 1184
情深已故
情深已故 2021-01-27 14:24

I have a drawing area, and an \'png\' image I want to load that image to my drawing area as background.

the screen is bigger then my image and the problem is it does not

1条回答
  •  不思量自难忘°
    2021-01-27 14:43

    i found the answer i put the code here for others

    area=gtk.Drawingarea()
    
    pixbuf=gtk.gdk.pixbuf_new_from_file('background.png')
    pixmap, mask=pixbuf.render_pixmap_and_mask()
    
    area.window.set_back_pixmap(pixmap, False)
    

    0 讨论(0)
提交回复
热议问题