Tout d'abord, je pense que le wxPython Docs et démonstrations font un travail grand expliquant comment utiliser leurs bibliothèques, en particulier parce que les démos peuvent être lus avec à la volée pour voir l'effet ou vous pouvez revenir à l'original. Voici le lien Windows pour télécharger tous les fichiers:
http://www.wxpython.org/download.php#binaries
Cela dit, voici le code exemple de la démo:
def runTest(frame, nb, log):
bmp = wx.Image(opj('bitmaps/image.bmp'), wx.BITMAP_TYPE_BMP).ConvertToBitmap()
gif = wx.Image(opj('bitmaps/image.gif'), wx.BITMAP_TYPE_GIF).ConvertToBitmap()
png = wx.Image(opj('bitmaps/image.png'), wx.BITMAP_TYPE_PNG).ConvertToBitmap()
jpg = wx.Image(opj('bitmaps/image.jpg'), wx.BITMAP_TYPE_JPEG).ConvertToBitmap()
panel = wx.Panel(nb, -1)
pos = 10
wx.StaticBitmap(panel, -1, bmp, (10, pos), (bmp.GetWidth(), bmp.GetHeight()))
pos = pos + bmp.GetHeight() + 10
wx.StaticBitmap(panel, -1, gif, (10, pos), (gif.GetWidth(), gif.GetHeight()))
pos = pos + gif.GetHeight() + 10
wx.StaticBitmap(panel, -1, png, (10, pos), (png.GetWidth(), png.GetHeight()))
pos = pos + png.GetHeight() + 10
wx.StaticBitmap(panel, -1, jpg, (10, pos), (jpg.GetWidth(), jpg.GetHeight()))
return panel
Ici, il montre comment charger une image et l'affiche sur un panneau. Certains objets ne sont pas expliqués ici, mais ils devraient vous donner l'essentiel.
Merci les gars, je vais essayer plus tard et donner la « réponse acceptée » –