Bitmap Objects

Bitmap objects represent graphics that imported into the Image Template file. Each bitmap object has its own name, data, and formatting options.

Note: The examples in this section assume that the bitmap object has the default name of bitmap. However, bitmap objects are not always named bitmap. In such cases, use the object name in place of bitmap.

Bitmap objects have the following methods:

method

 

addITXML

Syntax

 

bitmap.addITXML(itxml)

Description

 

Inserts the specified ITXML properties into this bitmap object. If a property has already been defined (e.g., in the Image Template file), this statement overrides it. If no Image Template file is currently open, this command creates a new Image Template file and inserts the specified object into the empty Image Template file. The ITXML in this file is appended to the ITXML from the Image Template file and from any previous addITXML commands.

Adding an image object that has the same name as an existing image object in the Image Template file replaces the existing image object with the new image object.

The bitmap.addITXML statement is useful for accessing features of Corda Server™ not available through the PCScript API. It allows you to add to or modify this object's definition within the actual Image Template file.

For example, PCScript does not allow you to dynamically define the border settings for a bitmap. However, you can use bitmap.addITXML to change the ITXML that defines the border settings. Example 1 illustrates how to do this. Examples 2 and 3 show how this statement affects the bitmap object's definition in the Image Template file.

Note that this only applies to properties of the <cit:image> object. To modify attributes of the <cit:image> tag (e.g., common="top:20;"), use the bitmap.setITXMLAttributes method.

Parameters

 

bitmap.addITXML accepts the following parameters:

 

 

itxml

String

 

 

A string of ITXML that contains valid properties for the <cit:image> tag. For more information, see ITXML.

Examples

 

Example 1: bitmap.addITXML Method Call

bitmap.addITXML(<Properties BorderType='Thin'/>)

Example 2: Image Definition before Calling addITXML in Example 1

<Image Name='bitmap' />

Example 3: Image Definition after Calling addITXML in Example 1

<Image Name='bitmap'>

<Properties BorderType='Thin'/>

</Image>

 

method

 

ddEnable

Syntax

 

bitmap.ddEnable(URL [, Target])

Description

 

Adds a drilldown effect to this bitmap object.

Drilldown effects include linking to a different Web page or executing a Javascript* function. The drilldown effect occurs whenever a user clicks a specific data item. For more information about drilldown effects, see Building Drilldown.

Parameters

 

bitmap.ddEnable accepts the following parameters:

 

 

URL

{ URL | Javascript function }

 

 

The Web page or Javascript function that the bitmap drills down to.

If the URL parameter is a Web page, the link is relative to the location of the Web page that contains the Corda® image. Prefix the URL with http:// to specify an absolute path.

If the URL parameter is a Javascript function, it must be prefixed with Javascript:. The function must also be declared within the Web page that contains the Corda image.

 

 

Target

String

 

 

(Optional) The target window or frame that the bitmap drills down to. Do not use this parameter when drilling down to a Javascript function.

Example

 

bitmap.ddEnable Method Calls

bitmap1.ddEnable(http://www.myserver.com/logo.html)

bitmap2.ddEnable(Javascript:dostuff(true))

 

method

 

hide

Syntax

 

bitmap.hide()

Description

 

Hides this bitmap object.

Use the bitmap.show command to make a bitmap object visible again after using this command.

 

method

 

loadFile

Syntax

 

bitmap.loadFile(newimage)

Description

 

Loads a new image into the bitmap object.

This new image replaces the image that was already in the bitmap object. Because the new image is scaled to fit within the dimensions of the bitmap object, make sure that the new image is the same size (or at least maintains the same aspect ratio) as the old image.

The image file must be in JPEG or GIF format and must be accessible to the machine running Corda Server.

Important: The path.xml file must grant Corda Server permission to read files from the location that you specify. Otherwise, it is unable to load the data. For more information, see Setting Path Permissions in the Corda 7 Install and Administration manual.

Parameters

 

bitmap.loadFile accepts the following parameters:

 

 

newimage

Filename

 

 

The path (relative to <document_root>) to the image that is loaded into the bitmap. Specify the path using either path or URL notation.

 

method

 

setITXMLAttributes

Syntax

 

bitmap.setITXMLAttributes(attributes)

Description

 

Inserts the specified attribute assignments into the bitmap object's ITXML tag. If an attribute has already been assigned (e.g., in the Image Template file), this statement overrides its assignment.

The bitmap.setITXMLAttributes statement is useful for accessing features of Corda Server not available through the PCScript API. It allows you to add to or modify this object's definition within the actual Image Template file.

For example, PCScript does not let you dynamically redefine the size and position of a bitmap object. However, you can use bitmap.setITXMLAttributes to change the ITXML attributes that define these settings. Example 1 below illustrates how to do this. Examples 2 and 3 show how this statement affects the bitmap object's definition in the Image Template file.

Note that this only applies to attributes listed in the object's <cit:image> tag. To modify properties of the <cit:image> tag (e.g., <Properties>), use the bitmap.addITXML method.

Parameters

 

bitmap.setITXMLAttributes accepts the following parameters:

 

 

attributes

String

 

 

A string of ITXML attribute assignments, each separated by a blank space. This string is essentially what follows image in an <cit:image> tag.

For example, to set the top attribute to 100, this string reads common="top:100;". This string can contain any number of attribute assignments.

For more information about ITXML, see ITXML.

Examples

 

Example 1: bitmap.setITXMLAttributes Method Call

bitmap.SetITXMLAttributes(common="top:20;left:20;width:300;height:300")

Example 2: Image Definition before Calling setITXMLAttributes in Example 1

cit:image name="bitmap" common="top:8;left:91;width:270;height:340">

...

</cit:image>

Example 3: Image Definition after Calling setITXMLAttributes in Example 1

<cit:image name="bitmap" common="top:20left:20;width:300;height:300">

...

</cit:image>

 

method

 

show

Syntax

 

bitmap.show()

Description

 

Makes this bitmap object visible.

By default, all objects are visible. Use this command to make a bitmap object visible again after using the bitmap.hide command.