How do I display an image on a GUI component such as a push button or axes?
NOTE:-
Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help , Finance Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.
To display an image on a GUI component, try these four steps:
1. Read in the image you want displayed on the component.
2. Make sure that it is a True Color Image.
3. Resize the image to fit on the component.
4. Create the component and set the 'cdata' property to be the image.
Below is an quick example of how to display an image on a pushbutton:
[x,map]=imread('ngc6543a.jpg'); I2=imresize(x, [42 113]); h=uicontrol('style','pushbutton',... 'units','pixels',... 'position',[20 20 113+10 42+10],... 'cdata',I2)
The following longer example walks through all four steps:
SEE COMPLETE ANSWER CLICK THE LINK
Comments
Post a Comment