MATLAB: How to change the size of an image loaded into the push button automatically when the window size of a GUI(GUIDE) changes.

guidematlab gui

Hello, I'm new to GUI. I am creating an user interface in GUI fusing GUIDE. I would like to include a fancy ''close'' image into the push button such that when I push the GUI should close. I successfully imported using property ''CData''. I am using the GUI size to proportional. I adjusted several times adjusting the size of push button and later when I resize the GUI the size of push button is changing automatically but not the image. Do I need to implement new function for this? Would you please suggest something on this code? I am attaching the image,code GUI, script file.
I need help and it's urgent.

Best Answer

Make sure the 'Units' property of all the controls on your GUI is set to 'Normalized'.