From: M Paheerathan on
I'm loading a Image to MatLAB GUI (axes) by using following command

loadImage = importdata([pathname,'/',filename]);
axis auto ;
axes(handles.axesMainImage) %select the axes
image(loadImage);%place image onto the axes

The problem is, Say for example my Image resolution is (2000*2000).
in the axis when I fit it it is fitting into (800x800) correctly and I can view the fully image correctly

but If I zoom it and by using right click menu, if I choose "Reset to original view"
Image is goes back to 2000 x 2000 and here in the axis I can see only the part of the Image, if I want to see other parts I have to Pan it (drag it by using pan option)

What I need is, If I zoom and then "reset to original view" it it should fit back to (800x800) even the image size is big. So I can see full Image back.

Could you please help me to do this? If Any clarification needed, please let me know.

Thank you,

Regards,
Paheerathan