Hi,
I am trying to display an image on a wx panel. I know what the image size is in pixels. I set the wxframe and wx panel size to exactly the size of my image. However when I run the script, I can see that the panel covers the image slightly. That means that most likely the panel does not have the exact same size as of the image. Anyone knows how I can fit the image exactly to the panel size ?
regards,
pluto
import wx
import os
class Panel(wx.Panel):
def __init__(self, parent, path):
bitmap = wx.Bitmap(path)
orgWidth = bitmap.GetWidth()
orgHeight = bitmap.GetHeight()
panelWidth = orgWidth
panelHeight = orgHeight
wx.Panel.__init__(self, parent,-1, size=(panelWidth, panelHeight))
self.ImgControl = wx.StaticBitmap(self, -1, bitmap)
self.ImgControl.Center( )
if name == ‘main’:
app = wx.PySimpleApp()
frame = wx.Frame(None, -1, 'Scaled Image', size=(1392, 1040))
panel = Panel(frame, os.path.join( os.getcwd(), "middleWhite.tif") )
frame.Show()
app.MainLoop()