how to insert image to gui?
이전 댓글 표시
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
답변 (2개)
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
sandy
2014년 5월 22일
Romain
2014년 5월 22일
Do you have the good Handle of your axis ?
Do you have an example of your code with the problem ? It will be helpful to give you a better answer !
sandy
2014년 5월 22일
Romain
2014년 5월 22일
I'm using the same code in one of my project, and the image is load in the equivalent of your axes1 of the GUI 'car_sample_2'.
So I don't understand why it's not working for you, sorry.
sandy
2014년 5월 22일
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.
erick rafael
2025년 1월 19일
편집: erick rafael
2025년 1월 19일
0 개 추천
My problem is persisting, i dont not continue, help me please.댓글 수: 1
Walter Roberson
2025년 1월 19일
It is not clear what you were doing that triggered this message?
That message looks a bit like you might get when attempting to attach an icon to a compiled application.
카테고리
도움말 센터 및 File Exchange에서 Display Image에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!