insert image in frame or panel?

6 visualizaciones (últimos 30 días)
researcher
researcher el 29 de Abr. de 2011
Hi I am want to create a panel or frame on the MATLAB fig such that when the user selects an image by clicking on the open button the image should open in the space that is alloted by the pre-designed frame/panel.How do I do this?

Respuestas (2)

Walter Roberson
Walter Roberson el 29 de Abr. de 2011
ph = uipanel(....)
pax = axis('Parent',ph);
Then to put the image up,
image(pax, ImageData)
  1 comentario
researcher
researcher el 29 de Abr. de 2011
this produces an axis over the panel which results in two white spaces on the figure. I want that the selected image should be displayed in the panel without showing axis!
I have pasted the code to open an image below!

Iniciar sesión para comentar.


researcher
researcher el 29 de Abr. de 2011
ph = uipanel('Title','Main Panel','FontSize',12,...
'BackgroundColor','white',...
'Position',[.25 .2 .67 .67]);
pax=axis('Parent',ph);
Then to put the image up,
image(pax,IMG)
[filename, pathname]=uigetfile( ...
{'*.jpg','JPEG File (*.jpg)'; ...
'*.*','Any Image file (*.*)'}, ...
'Pick an image file');
var=strcat(pathname,filename);
ORI_IMG=imread(var);
IMG=ORI_IMG;
% Showing the origional image
imshow(IMG);
title('original image');
end
  4 comentarios
researcher
researcher el 30 de Abr. de 2011
What does this line mean...."parent the imshow()"..I am new to Matlab.It would be great if you can please explain it through a code.Thanks!
Walter Roberson
Walter Roberson el 30 de Abr. de 2011
imshow(IMG,'Parent',TheAxisHandleToDrawOn)

Iniciar sesión para comentar.

Categorías

Más información sobre Read, Write, and Modify Image en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by