Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Please help with GUI

Subject: Please help with GUI

From: 7lines.ru@gmail.com

Date: 2 Nov, 2008 20:40:16

Message: 1 of 2

Program mast
1) load images to axes
2) when you push down Ctrl+mouse button and move it the program draws
a line on the image
3) Zoom image , scroll it in axes
4) save this image to file

Subject: Please help with GUI

From: Dave Brackett

Date: 2 Nov, 2008 21:47:01

Message: 2 of 2

I suggest you use the 'Guide' GUI matlab tool. Type 'guide' in the command window and the wizard will load. Lay out the GUI as you want using the controls on the left toolbar.

If you right click on each control once placed you can open the property inspector to change certain things about it, and also create a callback for each control. You will have to do this to achieve the 4 points you outlined. In the callback .m file you will probably use the following functions:

> 1) load images to axes

Give focus to the axes with 'axes(handles.axes1)' or whatever number it is. Use 'imshow' to show the image in that axes.

> 2) when you push down Ctrl+mouse button and move it the program draws a line on the image

Not sure why you would want to have to hold down 'control' to do this. Try 'imline'.

> 3) Zoom image , scroll it in axes

Use 'zoom'.

> 4) save this image to file

Use 'saveas'.

With all of these type 'help' before it in the command window and details about how to use them will display. It sounds like you also need to understand how to use callbacks with a GUI, and similarly there is documentation available for this from the help.

Have a try using those functions I suggest and if you have a specific problem post again.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us