For example, let's say I would like to design a GUI with a table that the user enters data into. I then want to have 2 push buttons: one that will save the data currently in the table, and another that will clear the data from the table. Are there any code examples/tutorials that explain in general how I can accomplish saving/modifying the state of uicontrols in a GUI in this way?
Doug Hull from the MathWorks has a nice video tutorial showing how to save and restore the state of a GUI.
You should also check out 41 Complete GUI Examples (specifically GUI_41.m) from Matt Fig on the MathWorks File Exchange.
It should be straight-forward to figure out from those examples how to also clear all the data from your GUI.
Related
I am trying to write a ray tracer and want to render my image in real time in a GUI window. Basically, I have a buffer: Vec<u8> that is constantly updating. The question is how do I display it on the screen after completing each row. I was thinking about using iced or egui, but couldn't figure out how to output changing image without copying it each time. Solutions that are using other toolkits are also welcome.
egui asks for TextureId:
ui.image(my_texture_id, [640.0, 480.0]);
but doesn't say where to get it
For egui there's some example here and a note here if you want to go 3D (with an example too).
For iced there's a bunch of examples, and some of them are using image/image_viewer (e.g. pokedex).
A way to go would be to copy their code, make it compile/run, and then tweak it with your logic. If something goes wrong - you'd have more input for a more concrete SO question.
Also I don't think that there's anything wrong per se in copying the data for the purpose of buffering (see this).
I am trying to create a script for drawing a frame around my photographs. I already have actions that will do that, but they're not perfect. I always have to tweak them after the frame is created.
The main fundamental problem I see with actions is that there can be no user interface. I want the user to be able to select parameters such as frame size, color, line width, and so on, before the frame is actually drawn. I would also like to give the user the ability to save their selections and recall them the next time the script is used.
The PhotoShop Scripting Guide just has a tiny section at the end about user interfaces. It says "Adobe provides the ScriptUI component, which works with the ExtendScript JavaScript interpreter to provide JavaScript scripts with the ability to create and interact with user interface elements." And it provides this link. But that link only goes to a page that describes, very incompletely, recent changes to that component. Can anyone tell me where I can find documentation that will teach me to use that component?
And in case it matters to anyone, I posted this identical question on Reddit.
The most comprehensive source is the ScriptingUI for Dummies pdf book by Peter Kahrel.
There's also an amasing WYSIWYG editor by Joonas Pääkkö — it makes the process so much easier.
There is also the scriptUI from Adobe.
And funnily enough, in the Adobe document, it states: "If you want to create your own ScriptUI dialogs but reading this guide is too much for you, head for Joonas Pääkkö’s excellent dialog builder at https://scriptui.joonas.me/"
So I am taking a remote internship and have been tasked with transferring a JPG or a PDF of an image and making it interactive so users can click on their choices, then at the end it determines an answer based on the choices you chose.
I am fairly new at web design and originally thought about creating an image map of the object and figuring out a way to store the selected choices.
Is this even possible? Is the owner of the company out of her mind trying to get interns with no web design experience or guidance to complete this task? If not, what is the best method for completing something like this? Would a PDF be better. Mind you there aren't even real results for this "quiz" yet.
Here is the image they want me/us to make interactive. Any advice or guidance would be greatly appreciative.
I'm looking for a tips that I can use to make the following as easy and/or re-usable as possible.
I need to recreate a paper based form in vb6, allow the user to fill in values and then be able to both print out and save the completed form.
I'm thinking of scaning the form and saving it as a jpeg.
Using this jpg as the picture in a picture box.
Overlaying it with checkboxes/textboxes etc.
Saving the values of the various controls to the database
etc.
It seems like a lot of work for just 1 form and not very re-usable.
is there a better way?
Well, if what you want is "easy" - there isn't any tool which will do everything you want automatically. There are tools to turn paper forms into PDFs - but you would still have to do the database work yourself.
As for "re-usable" - I suppose creating a simple web application will fulfill this criteria, because your users wouldn't have to install your application.
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.