From: M Paheerathan on
If I open a Image in MatLAB GUI say for example the resolution is (2000 x 1500) it fit to the axes correctly
Then after If I open another Image which has a different resolution (500 x 600), it doesn't fit to the axes and it uses the previous one(2000 x 1500) and display the (500 x 600) Image. So the difference is left as a white space
How to tackle this problem?

I want to fit to the axis always, If I open a the Images successively.


Thank you,


Best Regards,
Paheerathan
From: ImageAnalyst on
Paheerathan:
Try this code I yanked from one of my m-files:

% Display image array in a window on the user interface.
axes(handles.axesImage);
hold off; % IMPORTANT NOTE: hold needs to be off in order for the
"fit" feature to work correctly.
imshow(imageArray, [], 'InitialMagnification', 'fit');


From: M Paheerathan on
Doesn't work, are you missing any pre definitions (such as for InitialMagnification)

Please help me

Regards,
Paaheerathan
From: ImageAnalyst on
Works fine for me. Show the code that you're using because there are
several functions that can display images (imshow, image, imagesc,
pcolor, imtool, ...)
From: M Paheerathan on
This is my code. Please help me

[filename, pathname] = uigetfile('*.JPG', 'Pick an JPG file'); %Browse the file
loadImage = importdata([pathname,'/',filename]);
axes(handles.axesImage) % this gives focus to the axes o
hold off;
imshow(loadImage, [], 'InitialMagnification', 'fit');


Thanks in Advance,


Best Regards,
Paheerathan