Display Issues with Matlab Images in GUI
16 views (last 30 days)
Show older comments
I have a MATLAB GUI where I have displayed an image on a set of axes, and it looks fine.
However, when the GUI is opened on some other computer with (presumably) different resolution settings, the image is stretched and becomes pixelated. I have tried setting up the axis size based on both pixel units and characters, neither of which preserve the smooth original appearance of the image across all computers.
Does anyone have a solution for this?
It seems crazy to me that there doesn't appear to be an easy way to have a simple image, with known pixel height and width, appear properly in a Matlab GUI regardless of monitor and resolution configuration.
Thanks in advance!
4 Comments
David Barry
on 23 Dec 2016
Have you set the axes limits correctly? You could maybe try this instead of using image as it should sort out limits for you.
load('logo.mat');
imshow(thelogo, 'Parent', handles.axes1, 'Colormap', thecmap);
Can you upload a screenshot to demonstrate the issue?
Answers (2)
David Barry
on 23 Dec 2016
If you are running Windows (unlucky) then make sure your zoom settings are set to 100%. For some reason 125% seems to be the default on some OS. This has tripped me up at work where colleagues are on 125 and I'm designing GUI's on 100. This seemed to have an effect in later releases of MATLAB (maybe post 14b and HG2).
0 Comments
Image Analyst
on 23 Dec 2016
I often have trouble with the GUI not looking like mine when I compile and deploy it. It's caused by different video adapters and different resolutions. Try making the units property of all your controls 'normalized'. It helps but does not fix everything. Then try experimenting with different axis options like "axis image" or "axis equal" etc. Even that may not fix everything, especially controls with text on them. I still don't have a 100% solution for me, or for you. Maybe you can try App Designer - I haven't tried it yet.
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!