wxPython – Add Image in Button
In this article we are going to learn that, how can we add image in a button. So first of all we will create a wx.Bitmap object and initialize with the image we want to add to button. After this we will use SetBitmap() function associated with wx.Button class of wxPython.
SetBitmap() function takes wx.Bitmap object as parameter.
Syntax: wx.Button.SetBitmap(self, bitmap)
Parameter Input Type Description bitmap wx.Bitmap Bitmap set for button.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course