imagemode

Defines how the image will be displayed in the item.

Syntax

   <imagemode suppresstext="suppresstext value">image mode</imagemode>
Table 1. gradient parameters
Parameter Type Description
image mode String Must be one of:
  • clip: If the image is smaller than the item, the image is centered in the item. Otherwise, the image is placed in the item from the top left corner and the parts of the image that extend past the item's bounding box are cut off.
  • resize: Image is placed in the item from the top left corner. The image is then expanded or contracted in both directions so that it fits the item exactly.
  • scale: If the image is smaller than the item, the image is centered in the item. Otherwise, the image is placed in the item from the top left corner. The image is expanded or contracted, keeping the original aspect ratio, to the point at which one of the sides fits snugly in the item and the other side is smaller than the item.

The default image mode is resize.

suppresstext value String Optional. If present, must be either true or false. When true, only the image is displayed. When false, the text and the image are both displayed.

The default is false.

Available In

button, label

Example

This sample displays a company logo as a re-sized image.

   <image>page_1st.company_logo</image>
   <imagemode>resize</imagemode>

Usage details

  1. An imagemode of clip draws the image in the upper left corner of the item. If the image is too big for the item's space, and the image is clipped at the item's edge. If the image is smaller than the item in either horizontally or vertically, the image is centered appropriately.
  2. An imagemode of resize re-sizes the image to be the exact size of the item, whether that means an increase in size, decrease in size, or an increase in one dimension and decrease in the other.
  3. An imagemode of scale also re-sizes the image to fit the item, except that it will preserve the aspect ratio of the original image. If either dimension of the image is larger than the item, then the image will be made small enough to fit in the given space as follows:
    • The larger dimension will fit snugly in the space.
    • The other dimension will be scaled by the same factor.

      Likewise, if both dimensions of the image are smaller than the space given by the button or label, then the image will be expanded to fit the given space as follows:

    • The larger dimension will fit snugly in the space.
    • The other dimension will be scaled by the same factor.
  4. Use this option with the image option to control the image's appearance with button and label items.