내가 보통이 같은 일부 확장 코드를 사용 : 나는 그것을 적절하게 조정 일단 그런
img = wx.Image(filepath, wx.BITMAP_TYPE_ANY)
# scale the image, preserving the aspect ratio
W = img.GetWidth()
H = img.GetHeight()
if W > H:
NewW = self.PhotoMaxSize
NewH = self.PhotoMaxSize * H/W
else:
NewH = self.PhotoMaxSize
NewW = self.PhotoMaxSize * W/H
img = img.Scale(NewW,NewH)
을, 나는 wx.StaticBitmap에 추가 :
self.imageCtrl = wx.StaticBitmap(self.panel, wx.ID_ANY,
wx.BitmapFromImage(img))
self.imageCtrl.SetBitmap(wx.BitmapFromImage(img))
이 자체를 설정하십시오. 최적의 크기를 찾을 때까지 PhotoMaxSize을 다양한 양으로 늘리거나 wx.GetDisplaySize()를 사용하여 그 높이를 기반으로 파생시킬 수 있습니다.
또한 도움이 튜토리얼을 찾을 수 있습니다
:
을