Filter löschen
Filter löschen

Getting image only to popup

5 Ansichten (letzte 30 Tage)
Rooy
Rooy am 20 Mär. 2012
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
  2 Kommentare
Jan
Jan am 20 Mär. 2012
What does "without anything around it" exactly mean? A full screen image? No window border? No grey area between the image and the window border?
Rooy
Rooy am 20 Mär. 2012
I uploaded an image of what I really mean, thank you

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 20 Mär. 2012
It is possible to get rid of the taskbar, but not the box. It is not possible in MATLAB to create an image that is not within a figure. The figure might be nearly the same size as the image, but it will still form a box around the image.
Are you trying to get the image to appear within the popup? Your sample does not show a popup: it shows what appears to be a inputdlg().
  6 Kommentare
Walter Roberson
Walter Roberson am 21 Mär. 2012
My code does not define any output for popupimage(): it displays the image directly.
Jan
Jan am 22 Mär. 2012
@Zachary: Have you seen my answer? It *is* possible to get rid of all parts of the figure.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (3)

Image Analyst
Image Analyst am 20 Mär. 2012
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 Kommentare
Image Analyst
Image Analyst am 21 Mär. 2012
Change InputFileName in the figure() call to ImageFileName
Rooy
Rooy am 22 Mär. 2012
At last, it works, thank you very much

Melden Sie sich an, um zu kommentieren.


Walter Roberson
Walter Roberson am 21 Mär. 2012
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 Kommentare
Rooy
Rooy am 21 Mär. 2012
I get that what I was asking is not possible in Mathlab but I wanted to try out your code but it does not work. How would I use it properly?
Thank you
Jan
Jan am 21 Mär. 2012
Matlab, the program is called Matlab.

Melden Sie sich an, um zu kommentieren.


Jan
Jan am 21 Mär. 2012
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);

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by