Matlab GUI using getappdata and setappdata - user-interface

Basically what I want to do is have one gui that is just a title and a push button that calls uigetfile(), and once the user selects an image, the gui closes, and opens a new gui that contains the image, functions applied to the image, and information about the image. I have made all the code for everything, I just can't figure out how to use setappdata and getappdata so that the new gui opens with everything I want.

Mathworks website contains detailed information for most of matlabs functions.

Related

Put Text on Image from database while editing image in Canvas

I have a question and i am confused what strategy i should choose to solve this.
Here is the description.
I have a gallery which is managed on user authentication.
Next I have basically a simple form which saves quotes into database.
Selecting an image from gallery it is opened in a canvas. I am using Adobe Creative SDK.
Here is the demonstration image.
Next i have to select(copy) text from database to add(paste) in text field but i have no idea how to do it.
This is the task i have to do for a client. I have never seen a similar example. This is seems unique. Please provide some suggestion on doing it.
Adobe Creative SDK's editor will not allow you to pre-populate text on an image so it's out of the question for this task. You could probably find a way to overlay text on top of the Adobe editor, but then the issue with saving the image rears its head.
If you don't need any of the other editing tools, you could simply create a canvas with the image, overlay the text and allow the user to choose the font, position the text, apply stamps, etc...
Once they're done, wire up a save button to post the field with the contents of canvas.toDataURL('image/png') and have something server-side to save it.
It will be more work than using someone else's widget, but the client will be in control of their own destiny (and have a working product which they wouldn't have before).
Keep it simple and build from there.

How do I save the whole matlab gui panel?

I can save a particular figure or an axes by using export_fig procedure. The command used is like the following:
export_fig(handles.Myfigure, filename). % This code is available on line
But I am trying to save a copy of the main gui (like a screen shot of the whole for record keeping). I guess this could work if I knew the handle of the main panel.
Can anyone help?
Thanks
http://www.mathworks.com/help/techdoc/ref/getframe.html
Get coords of window and dimensions and pass it to this function.

Using images in Matlab GUI

I'm working on a small image processing project in MATLAB. I have worked with MATLAB before, but never created a GUI. The GUI I want to create could be pretty advanced, so I need some hints on how to get started.
The purpose of the GUI would be to load an image and have it shown to the user. The user then has to click on two points in the image, of which the coordinates are stored (in pixels) in a variable. If possible, a colored dot is shown where the user has clicked. After the user finished with the current image, he can load a next one.
I have some experience with Java, and I think this wouldn't be too hard in Swing. But MATLAB seems like not having the purpose of creating such an advanced GUI. However, the whole project until now is in MATLAB, so it would be nice if I could manage to do it. Any help? Hints? Things I should look at?
Thanks a lot.
This is not a very complex task to be done in MATLAB.
For simple instructions about adding a picture to a GUI, take a look at this post:
http://blogs.mathworks.com/pick/2007/10/16/matlab-basics-setting-a-background-image-for-a-gui/
For instructions on various interactions between GUI axes and the mouse pointer, check this video (keep in mind that your picture in the GUI lies within normal MATLAB axes):
http://blogs.mathworks.com/pick/2008/05/27/advanced-matlab-capture-mouse-movement/
In general, Doug's tutorial videos are great for MATLAB beginners, and I'd advise you to take a look at more of them.

Mirroring a portion of the screen to an external display (in OSX)

I would like to write a program that can mirror a portion of the main display into a new window. Ideally this new window could then be displayed on an external monitor. I have seen this uiltity for a flightsim that does this on a pc (a multifunction display extractor).
CLick here for a screenshot of the program (MFD Extractor)
This would be a live window ie. constantaly updated video display not just a static graphic.
I have looked at screen magnifiers or vnc clients for ideas but I think I need to write something from scratch. I have tried to do some reading on osx programing but where do I start in terms of gaining access to the display? I somehow need to extract the graphics from a particular program. Is it best to go near the final output stage (the individual pixels sent to the display) or somewhere nearer the window management stage.
Any ideas or pointers would be much appreciated. I just need somewhere to start from.
Regards,
There are a few ways to do this:
Quartz Display Services will let you get access to the video memory for a screen.
Quartz Window Services (a.k.a. CGWindow) will let you create an image of everything that lies below a window. If you create a borderless, transparent, empty, high-level window whose frame occupies an entire screen, everything below it will be everything on that screen. (Of course, you could create a smaller window in order to copy a section of the screen.)
There's also a way to do it using OpenGL that I never fully understood. That technique is demonstrated by a couple of code samples, OpenGLScreenSnapshot and OpenGLCaptureToMovie. It's more or less obsoleted by CGWindow, though.
Each of those will get you an image that you can then show or write to a file or something.
To show an image, use NSImageView or IKImageView. If you want to magnify it, IKImageView has a zoomFactor property, but if you want nearest-neighbor scaling (like Pixie, DigitalColor Meter, or xScope), I think you'll need to write a custom view for that (but even that isn't all that hard).

How to programmatically create a 'bright' and a 'gray' version of an icon?

In a win32 application, I want to have a button with an icon which looks gray when the button is disabled and 'brighter' when the mouse hovers.
I know I can create three bitmaps with an icon editor, but since the icon can be user selected and loaded from the disk, I would like to create the other two versions programmatically.
So, starting with a handle to an image, I would like to:
- Create a new image with all colors converted to grey.
- Create a new image with all colors shifted to white or yellow.
Can this be done using win32 api calls?
Examples in any language will be appreciated.
Maybe the good old DrawState function will suffice. (For some reason it is now listed as only available from Win2000 which is not true.)
And maybe not, in which case you might want to use SetColorAdjustment function.
If the icon is user-selected do you control the format? If not you'll probably want to incorporate an image library or external process like DevIL or Imagemagick which handle more formats than Microsofts API's are likely to..

Resources