Bitmap

Description

The Bitmap element specifies a particular bitmap image, and the image's width and height.

Context

Table 1 lists the elements that can contain, or be contained by, a Bitmap element.

Table 1. Context
Contained by Element Contains

Pattern or PointStyle

Bitmap

ColorAdjustmentSet

Attributes

Table 2 lists the attributes of a Bitmap element.

Table 2. Attributes
Attribute Description

id

A unique identifier for the element.

name

A descriptive name for the element.

uri

Any of the following:
  • A network protocol, and the network location of a bitmap image to fetch using that protocol. The available protocols are: ftp, http, file, https, or the URI scheme name of a custom protocol.
  • A reference to a brush in the mapinfo codespace, which specifies a fill pattern code. For example: mapinfo:brush 71. The available fill patterns, and corresponding pattern codes, are shown in Fill Pattern Codes.
  • The filename of a bitmap image. The image file must be contained in a JAR file that is in the CLASSPATH. If the image file is located in the top-level internal directory of the JAR file, then the attribute value is the image filename only. If the image file is located in a lower-level internal directory in the JAR file, then the attribute value is the internal path to the image file within the JAR file, with a forward slash used to separate each directory level. Note that in either case, you do not use a forward slash at the beginning of the attribute value.

height

A floating-point value specifying with height of the bitmap image. Alternatively, the special value native can be used to specify the native height of the bitmap image.

width

A floating-point value specifying with width of the bitmap image. Alternatively, the special value native can be used to specify the native width of the bitmap image.

unit

A reference to an imagesize in the mapinfo codespace, which specifies a unit.

The unit attribute is optional. The default value is mapinfo:imagesize pixel.

Example

This example uses a reference to a brush in the mapinfo codespace to specify a solid fill pattern.

<?xml version="1.0" encoding="UTF-8"?>
<NamedStyle
    version="MXP_WorkSpace_1_5"
    xmlns="http://www.mapinfo.com/mxp">
    <Interior fill-opacity="1" fill="(#id7)">
        <Defs>
            <Pattern id="id7">
                <Bitmap uri="mapinfo:brush 2">
                    <ColorAdjustmentSet>
                        <ColorAdjustment
                            color-1="nonWhite"
                            color-2="rgb(224,255,176)"
                            opacity="1"/>
                        <ColorAdjustment
                            color-1="white"
                            color-2="white"
                            opacity="1"/>
                    </ColorAdjustmentSet>
                </Bitmap>
            </Pattern>
        </Defs>
    </Interior>
</NamedStyle>