How to make a special slider (or jslider) with areas after minimum and maximum range on Matlab?
Please see the illustration:
Thanks
You need a custom Java control, using a custom paint() method. I suggest that you repost your question as a Java Swing question (tags Java, Swing, JSlider) - this should get you some responses. Then use the control in Matlab as usual.
Related
I have created a basic MATLAB UI (without using GUIDE). I basically have a bunch of panels for various things, (sliders, axes, text boxes, etc).
The one thing I would like to do though, it make it so that they scale properly, when I resize the figure. Right now, I painstakingly have to make a re-scale function for every button, panel, sub-panel, etc etc to make it rescale correctly.
Is there an easy way to simply automate the re-scaling here?
Thanks.
Use the GUI Layout Toolbox from the MATLAB File Exchange. I haven't personally used dynamic resizing functionality, but that's one benefit of using this package.
It functions much like using uicontrols, except you can't use the inspect tool on these objects.
EDIT: If you're looking only to do resizing when the figure itself is resized, set the Units property for all your uicontrols to normalized.
You could also use the builtin, but undocumented uigridcontainer and uiflowcontainer.
They have the benefit of e.g. allowing to set contraints, such that e.g. your pushbuttons don't get increased in size, when the full figure does. Check the link for some examples:
http://undocumentedmatlab.com/blog/matlab-layout-managers-uicontainer-and-relatives/
I'd like to add a real-time graphical representation of what's going on behind some scala code. Just a black window of a given size where I can put colored pixels at random (x, y) points will do. That's exactly want I'll be doing, actually.
What library should I use? I want to stay as simple as possible, so as to avoid mixing in (say) a full-fledged game-writing library just for a quick and dirty way to place pixels on a canvas.
I'd just use the Java 2D Graphics API.
Scala has support for Java's Swing GUI API, see the scala.swing package in the Scala API documentation.
Can anybody help me please?
I should create a graph to display the nodes positions using eclipse. The positions are given as (X,Y) coordinates. Is this possible to do using Zest?
Or can you recommend other tool? (Note that I'm using eclipse RCP for other parts of the user interface)
Thank you in advance
If you already have the (X,Y) coordinates, Zest would not help you a lot, as it is centered around the concept of automatic layouting which does not work well with existing coordinates (however, it is possible to write a domain-specific layout algorithm that works with this input).
My opinion is that if supporting dragging of nodes (and possibly zooming) is a requirement, go and use Zest, in the end it will help you a lot. However, if you only need to draw a static graph without complex user interaction, I suggest drawing it by hand using either an SWT Canvas or Draw2d.
For example, I have a CGImageRef and I want to shift all pixels which are red to orange. Or to put it in other words: I want to apply a value function on every pixel in an image, which modifies the pixel based on the RGBA values it has. So the value function would calculate the new component values for that pixel based on the current component values and some algorithm applied to it.
I know how I could code that by hand with about 100 lines of code, but I wonder if there is a easier and maybe even faster way?
I believe Brad Larson has mentioned somewhere that things like this can be done on the GPU easily and fast. However, I must support iOS 3.2 so it should not get too fancy.
Would be happy about any ideas.
Thanks!
As far as I know there are no built in functions to achieve what you want.
The easiest way to get GPU acceleration when doing custom image manipulations on the pixel level is using the Accelerate.framework. Accelerate will use the 'best execution path' based on available hardware.
However... the port to iOS was only done for iOS4
(disclaimer: I have little to no experience nor knowledge of everything that's possible in OpenGL, so take my answer as limited within the Core Graphics realms of iOS)
how to do morphing of two images in iphone programming.?
Your question is not iphone related.. the kind of algorithm you are looking for is language-agnostic since it just work with images.
By the way it's quite complex to morph two images, usually you have to
embed a grid of points over the two images that links characteristics that should be morphed. For example if you have two faces you would use a grid that connects eyes, the mouth, ears, the nose, the edge of the face and so on: these two grid tells the morpher how to "translate" a point into another one while blending the two images
the previous step can be done automatically (with specific software) or by hand. more points you place better will be your results
then you can do the real morphing sequence: basically you do an interpolation between the two images (in which the parameter that you use will decide how much will be the final risult similar to the first or the second image)
you should also apply some blending effect to actually create a believable result, always using a parametric function according to the morphing position
You can use UIView animation to transition from one UIView to another. This should provide some sort of lame morphing.
You can use XMRM, which is written in C++: http://www.cg.tuwien.ac.at/~xmrm/
There is no image morphing API in the iOS SDK.
No, there isn't an API for it. You'll have to do it yourself.
...ask a short question, get a short answer...