how to insert image to gui?
조회 수: 51 (최근 30일)
이전 댓글 표시
i want to insert image to gui.i created axes and tried to insert.imaged is loaded,but error is ,imaged not loading inside the axes og gui o/p.it opening as separate image window.help needed
댓글 수: 0
답변 (1개)
Romain
2014년 5월 22일
편집: Romain
2014년 5월 22일
You can use the function 'axes' to select the axe for your image :
axes(axisHandle)
matlabImage = imread('image.png');
image(matlabImage)
axis off
axis image
if you are using GUIDE, add this code in the OpeningFcn
댓글 수: 7
Romain
2014년 5월 22일
Nothing in particular. For Example, I have create a new project in GUIDE : an 'GUI with Axes and Menu' and just add this line in the test_OpeningFcn:
axes(handles.axes1)
matlabImage = imread('C:\UsersDocuments\image.jpg');
image(matlabImage)
axis off
axis image
And it's working perfectly.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!