How to include a picture in .fig using GUIDE and no .m file

2 views (last 30 days)
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?

Accepted Answer

Image Analyst
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
maikuzz
maikuzz on 8 Nov 2015
Why there is no OpeningFcn available for the individual controls? And where could I edit/defining an OpeningFcn for the whole GUI?
Remember I'm just generating the .fig file; in this case I don't want to write in any .m files
Image Analyst
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.

Sign in to comment.

More Answers (0)

Categories

Find more on Environment and Settings in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!