Background image is not taking full length height from the bottom. Is there someone to have any approach to get it full length height for parent control(panel).
I have placed a background image in panel. and also resizing and scaling background images accordance to panel size. Please find below code sample.
import wx.grid
class Frame ( wx.Frame ):
def __init__( self, parent ):
wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u"Test", pos=wx.DefaultPosition, size=wx.DefaultSize)
self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
bSizer11 = wx.BoxSizer( wx.HORIZONTAL )
self.img1=wx.Image(".\splash.png", wx.BITMAP_TYPE_ANY)
self.m_bitmap3 = wx.StaticBitmap( self, wx.ID_ANY, wx.BitmapFromImage(self.img1), wx.DefaultPosition, wx.DefaultSize, 0 )
bSizer11.Add( self.m_bitmap3, 1, wx.EXPAND, 0 )
self.Bind(wx.EVT_SIZE, self.onResize)
self.SetSizer( bSizer11 )
self.Layout()
self.Centre(wx.BOTH)
self.Show()
def onResize(self, event):
frame_size = self.GetSize()
frame_h = (frame_size[0])
frame_w = (frame_size[1])
img1 = self.img1.Scale(frame_h,frame_w)
self.m_bitmap3.SetBitmap(wx.BitmapFromImage(img1))
self.Refresh()
self.Layout()
if name == “main”:
app = wx.App()
Frame(None)
app.MainLoop()
The output is something like