Graphics, frames, and text in a diagram

Revision as of 01:00, 5 August 2017 by Lchrisman (talk | contribs) (Resizing images)



Release:

4.6  •  5.0  •  5.1  •  5.2  •  5.3  •  5.4  •  6.0  •  6.1  •  6.2  •  6.3  •  6.4  •  6.5


Adding graphics

You can add a graphic image created in another application to any node or to the diagram background.

To paste in a graphic:

  1. Copy (Control+c) the graphic to the clipboard from within a graphics application.
  2. Make sure that the edit tool is selected in Analytica.
  3. (Optional) Select the node or the diagram window where you want the graphic to appear.
  4. Paste (Control+v) the graphic from the clipboard.

When you paste a graphic into the diagram window without a node selected, a special node of class Picture is created. Picture nodes can be placed on top of variable, module, and function nodes. When you select a node in Step 3, the image is placed inside that node.

To remove a graphic, select it and press Delete, or choose Clear from the Edit menu. When the image in inside a non-picture node, select the node, then click again on the image itself to select the image inside the node and press Delete.

Converting image formats

Some applications post bitmap graphics on the system clipboard in compressed image formats such as PNG or JPEG. When Analytica recognizes a compressed format, it imports the image and stores it internally in that format. Unfortunately, most applications post images only as full uncompressed bitmaps. Large uncompressed bitmaps can consume a lot of space and result in very large model files; therefore, when Analytica pastes an uncompressed bitmap, it converts it and stores it internally as compressed (lossless) PNG format. Any transparency and alpha blending present in the original image are preserved by this conversion.

Very old releases of Analytica do not recognize these compressed bitmap formats. If someone else loads your model in Analytica release 4.0 or earlier, these images will not display. If you want your bitmap images to display when your model is loaded into Analytica 4.0 or earlier, you must convert them back into the Legacy Bitmap format after it has been pasted into your model. To do this:

  • Make sure the edit tool is selected.
  • Select the image node to convert.
  • Select Change Picture Format from the Diagram menu.
  • In the Change Picture Format dialog, select the new format to use.

These steps can be used to convert any image into any desired internal image format. In some cases, certain conversions can further reduce the amount of memory (and thus model file size) consumed by the image. Legacy Bitmap files might lose some information in the image (such as transparency and alpha blending), and might consume much more space.

Images that are stored in the Mac PICT format do not display from Analytica Cloud Player (ACP) and cannot be rendered by the Analytica Decision Engine (ADE). Images in this format might be present in older Analytica models. Using the above steps, these images should be converted to EMF if you intend to post your model on ACP or render them from ADE.

Adding a frame

You can create a rectangular frame for nodes in a diagram in either of the following ways:

  • Paste a graphic into the diagram window to create a picture node, then delete the graphic. This leaves a blank picture node. Use the Node Style dialog to display the border of the node. Other nodes can be placed on top of this node.
  • Create a decision node and leave the title blank. Give it a definition of 0 (or any number) to remove the cross-hatch pattern. Use the Node Style dialog to hide the label and fill color. Create this frame first, then create the nodes to be framed and place them in the frame. If you create a framing decision node after you create the nodes to be framed, the nodes are “under” the framing decision node; they are visible, but you cannot select them. To place the decision node underneath the other nodes, select the decision node while in edit mode, right mouse click and select the Send to Back command from the pop-up menu.
  • Create a text node by dragging a text node from the text button Chapter9 20.png on the toolbar. Use the Node Style dialog to add a fill color and border to the node.

Adding text

To add text to a diagram, drag a text node from the text button Chapter9 20.png on the toolbar to the diagram and enter the desired text. This creates a new node with a special class text. Use the handles to resize the node, and use the Node Style dialog to change the font or to change the background from transparent to filled.

Image OnClick events

When an end-user clicks on the image of a Picture node, its OnClick expression is evaluated, it one exists. This attribute contains an expression and works the same way as for a button.

Within the expression for OnClick, you can reference local variables click_x and click_y, which contains the coordinates of the mouse click relative to the top-left corner of the image. Thus, you can create event handling code that alters its behavior based on where the mouse is clicked.

Resizing images

(New to Analytica 5.0) To resize an image from edit mode, select the node that contains the image, then click again on the image to select image part of the node. The selection handle will appear at the image corners instead of at the node corners (for most picture nodes, this will be just a few pixels different). Drag the corner handles to change the image size.

See Also


Comments


You are not allowed to post comments.