# Image

Displays an image within the report.

### Description

Reports often display images in various formats: corporate logos, product images, icons, and so on. Popular image formats are JPEG for photographs, and GIF, PNG and SVG for computer-generated graphics such as logos.

The image item provides an image in one of a number of formats. The image can come from a number of sources. The image item can be sized to the image (in which case the height and width attributes are ignored), or the image can be sized or clipped to fit the item. Images are always scaled proportionately.

The image item is similar to the Image report element in RDL, the image control in AFC and the picture item in Crystal. Key features include:

- Store the image as part of the report design, obtain the image at run time, or reference the image at view time.
- Allow the image to come from a BLOB field in the query.
- Associate a hyperlink with the image.
- Support line images. This is an image that is repeated to form a line. For example, a slice of an image can repeat to form a custom border along the top or side of a report. Allow repetition across or down.

The image element should provide a number of options for handling images that are larger or smaller than the size of the element itself:

- Clip the image to fit the element. Provide options of clipping all four edges so the image remains centered in the element, or clipping the bottom and left edges.
- Expand or shrink the element to fit the image size. This is the default, and works well for reports that use the power-assist form of layout (see below.)
- Adjust the element size to fit the image.

The following table shows which properties are used for each image source type.

Property | Embedded | File | URL | Computed
Image Name | X |  |  |
URI |  | X | X |
Value Expression |  |  |  | X
Type Expression |  |  |  | X
Size | X | X | X | X

### XML Summary

### Inherited Properties

dataSet
  Allows the user to fetch the image from a data set. The image is in the first row of the data set.
toc
  While the image can appear in the TOC, it is generally not very useful to do so.

### See Also

## action

An optional hyperlink for this image.

### Description

Provides a hyperlink from this image.

### See Also

## helpText

An optional help text for the image.

### Description

An optional help text for the image. The help text can contain HTML formatting and can be externalized. The web viewer shows this as "balloon help."

### See Also

helpTextID property

## altText

An optional text message to display in place of the image in a web browser.

### Description

An optional text message to display in place of the image in a web browser.

### See Also

altTextID property

## altTextID

Resource key for the altText property.

### Description

Resource key that allows externalizing and localizing the value of the altText property.

### See Also

altText property

## source

The kind of image reference.

### Choices

- file: The image is in a file.
- url: image is given by a URL to be evaluated at presentation time.
- embed: The image is embedded within the design.
- expr: The image is returned by an expression. (Not in the first release.)

### Description

The image can be provided in a number of formats. The choice here determines which of the other properties that BIRT will consider when obtaining the image value.

The expr option is not available in Release 1.0. That is, the image cannot be retrieved from a database in Release 1.0.

### See Also

## uri

The identifier for the image if the type is File or URL.

### Description

The identifier for the image if the type is File or URL. The type of image is inferred from the image file content or HTTP response.

### See Also

## imageName

The name of an embedded image if the Source type is Embedded.

### Description

The name of an embedded image if the Source type is Embedded.

### See Also

## valueExpr

An expression which returns the image contents.

### Description

An expression which returns the image contents.

### See Also

## typeExpr

An expression that returns the type of the image expressed as a MIME type.

### Description

An expression that returns the type of the image expressed as a MIME type: image/jpeg, image/png, image/gif, etc. If omitted, BIRT will attempt to infer the image type from the data in the image itself.

### See Also

## size

How to manage the relationship between image and item size.

### Description

### See Also

## onCreate

Script executed when the element is created in the Factory.

### Description

Executed when the element is created in the Factory. Called after the item is created, but before the item is saved to the report document file. See the scripting spec for additional information about this script. Applications should perform visual customization in the on-render script instead.

## onPrepare

It is for a script startup phase. No data binding yet. The design of an element can be changed here.

### Description

It is for a script startup phase. No data binding yet. The design of an element can be changed here.

## onRender

Script executed when the element is prepared for rendering in the Presentation engine.

### Description

Executed when the element is prepared for rendering in the Presentation engine. Changes made to the element are written to the target output format, but not saved to the report document file. This is the preferred place for visual customizations.