how to display two different bitmap images in canoe? - panel

I would like to display two different images in the panel based on event, example, for light on display one bit map image, And for light off display another bitmap image.
I already tried to browse the options in properties box there is not much information available regarding this, did anybody have solution for this issue?

Usually you would use a Switch/Indicator control and use a bitmap that includes all states in one image. See chapter "Assigning and Creating Bitmaps" in the manual.

Related

Anylogic: how to export a model without Anylogic cloud?

I am using the PLE of Anylogic. I would like to know if it is possible to export a model of Anylogic as PNG or JPEG. I don't want to use Anylogic cloud but I simply need an image of the template.
One available option is the "Create documentation" which you can find under the "Tools" button in the top toolbar. This will create a PDF with images of your model as well as tables summarizing all your code and parameters' values.
But if you only need an image, why not just take a screenshot? You can also select all your model's element, copy and paste in Paint for example.
Is that what you need? Or did I misunderstand the question?
In case your model is too big, you can do several things (from easiest to hardest):
make several screenshots, and then get them together
use the zoom to get a wider view and get the whole picture in one
use viewAreas of different size to view whatever you need to do
change your UX so as to see different information in different views (and then screenshot whatever you find more useful from those views)

How to control the size of image attachments in a NSTextView

By default, in a NSTextView, image attachments are displayed at their actual resolution. For large images, this results in having only a small portion of the image displayed in the view. This doesn't look good and the user has to do lots of scrolling to enter text after the image.
For example, in the window below, you can't tell much about the image in the text view.
So the question is: how to scale down image attachments, so that they fit in the NSTextView?
You can find a few solutions for this on the internet, based on subclassing NSTextAttachmentCell, but by doing so, you lose a number of good behaviors provided for free by the NSTextView, like the creation of annotations in an attached image.
Actually there is a much simpler solution: to use a NSLayoutManager property named defaultAttachmentScaling that does exactly what we want.
In your code, set this property as in:
myTextView.layoutManager.defaultAttachmentScaling = NSImageScaleProportionallyDown;
and this is it: large images are now scaled to match the width of the text view.
For detailed information on this property, I suggest you read the comments in the header file NSLayoutManager.h.
Note for iOS developers: unfortunately, this property is not available on iOS.

How to add a colored filter effect on an image?

I am building an Eclipse RCP application, based on eclipse 3.5.
I'd like to modify an image at runtime. The image is loaded and will be used as an icon, but depending on the situation, I'd like to add a filter on the image to give it a red or orange color, depending on some user-configured value.
It's the image transformation that I'm interested in. I already know how to get the image and ask a component to display it.
Has anybody done that? Thanks for your help :)
There are possibly many choices for doing just that, you can use ImageIO to load an image as BufferedImage and then get the Graphics2D and modify it as you wish. When you are finished modifying you can reaasign the newly created image back into your component which holds the original image and thats it.
You can of course look for some libraries to allow you easier image manipulation, maybe jmagick or something similar.
You can use DecoratingLabelProvider with a suitable ILabelDecorator. See also FAQ What is a label decorator?

Qt - using Widgets and QLabel to display multiple images

So currently I am able to display images via URL's using QLabel, QNetworkManager and QPixmap. And then to display the image I use something like label->show(). Essentially I follow the same steps as in the pseudocode in this link:
http://developer.qt.nokia.com/forums/viewthread/7010
Now I am still somewhat new to Qt and am having difficulty extending this. What I want to do is be able to display multiple images from different URL's into essentially the same container. So basically I want to see two images in the same container/window. These images are specified by their width, height, x position and y position in the main window/container. I know that I should use widgets but I am not sure what exactly should I use? QFrame? QHBLayout? QScrollArea? etc. Any help would be appreciated.
You can use many QLabels inside a Layout to get the effect you want. The way you want to lay it out is up to you, and there's more than one layout manager. There's things like the grid layout, the box layout, etc. Have a look here for layouts. You can look at it in this simplified way:
One window has a layout and a layout has many items in it.
http://doc.qt.nokia.com/latest/layout.html
In reality widgets can contain many other widgets. To position them properly, you use the layout.

how to create image viwer in matlab dynamically?

I have many images to display and do paint on them. I want to use axes objects in the matlab gui for individual images which should off course be scrollable. I dont know that how to create axes objects for individual images programmatically. Second is that I wanna create only one callback for all of them. I am wondering if someone can really help or point to some link as I did not find any good information.
Thanks
This should be a helpful start : Plotting Dynamic MRI Slice Images in MATLAB

Resources