Getting image only to popup
이전 댓글 표시

Here is what I need

I just want the image to appear just like a picture, without anything around it.
Here the part of the code
while n<=0 %Error tester
sun = imread('index.jpeg');
imshow(sun);
Thank you
n=inputdlg({'7'});%Just an example
n=str2double(n);
end
Thank you everyone for the help
채택된 답변
추가 답변 (3개)
Image Analyst
2012년 3월 20일
0 개 추천
Try this (assuming it's all the gray surround that you don't like/want):
How do I add a background image to my GUI or figure window?
댓글 수: 9
Rooy
2012년 3월 21일
Image Analyst
2012년 3월 21일
Well turn the menubar and toolbar off like Walter showed. I ran Walter's code and it gives what you want except that it has a titlebar. But I think I remember seeing a discussion earlier where people said that was difficult or impossible to get rid of. Perhaps if you use DirectX, but do you really want to go through all that trouble? What's wrong with Walter's solution? Why can't you live with that?
Rooy
2012년 3월 21일
Image Analyst
2012년 3월 21일
popupimage() takes a filename string, like 'cameraman.tif'
Rooy
2012년 3월 21일
Image Analyst
2012년 3월 21일
Like Walter said, just try:
popupimage('index.jpeg');
If you want a return argument (that is, imagedisp), you'd need add a return argument to the "function" line of code, like this:
function im = popupimage(ImageFileName)
If you do that, then you can do it the way you did it.
Rooy
2012년 3월 21일
Image Analyst
2012년 3월 21일
Change InputFileName in the figure() call to ImageFileName
Rooy
2012년 3월 22일
Walter Roberson
2012년 3월 21일
0 개 추천
Your desired output cannot be achieved in MATLAB, unless perhaps it can be done by using the JAVA level. Images must appear within figures in MATLAB, and figures always have frames in MATLAB: they cannot be borderless.
It is also difficult to get rid of the window controls (resize / minimize / close); I do not know if it can be done in MS Windows.
댓글 수: 4
Rooy
2012년 3월 21일
Walter Roberson
2012년 3월 21일
The code I gave was "To pop up an image with as little decoration as you can" and was not designed to act as an input routine. That "popupimage" routine cannot be used to return a value to the calling routine: it was designed for a different purpose.
Your design requirement *as given in your imageshack image* is something that cannot be achieved in MATLAB.
Rooy
2012년 3월 21일
Jan
2012년 3월 21일
Matlab, the program is called Matlab.
Jan
2012년 3월 21일
If you are working under Windows, FEX: WindowAPI let you crop an arbitrary rectangle from the figure. Use the pixel position of the axes to hide everything but the image:
set(AxesHandle, 'Units', 'pixels');
WindowAPI(FigureHandle, 'Clip', get(AxesHandle, 'Position'));
You can access, e.g. close, the window from the commandline only afterwards:
delete(gcf);
카테고리
도움말 센터 및 File Exchange에서 Images에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!