How to include a picture in .fig using GUIDE and no .m file
2 views (last 30 days)
Show older comments
The task is to include a picture in a .fig file using GUIDE, without using and generating the .m file (Tool --> GUIoption --> Generate FIG file only). It's clear I need to insert a Axes Box and using createFcn try to insert the picture. It seems that GUIDE does not recognise Matlab function like imshow('name.png').
Any ideas how to do it?
0 Comments
Accepted Answer
Image Analyst
on 7 Nov 2015
GUIDE recognizes imshow(). You just need to have an axes on the figure before you use it (I think, though it may create a new figure with an axes on it if you don't already have an axes). imshow() used to be part of the Image Processing Toolbox but in 2015 it moved into base MATLAB.
4 Comments
Image Analyst
on 8 Nov 2015
GUIDE always creates an m-file. There has to be code to create a GUI. If you don't want that, use Photoshop.
The OpeningFcn is for the whole GUI. Individual controls have something like that with their CreateFcn, though in my observations, you just get into trouble if you start messing with those. Besides, you don't need to -- anything you would do in the CreateFcn can be done directly in GUIDE's property inspector, or in the OpeningFcn. Don't worry about it - it's just the way it works.
More Answers (0)
See Also
Categories
Find more on Environment and Settings in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!