[Cover] [Previous Section] [Next Section] [Index]
Current chapter: Using Images in HDML
Section 30 out of 67 total sections
, Section 2 out of 3 sections in this chapter
Using images in HDML
To include an image in formatted text, you use an <IMG> statement. You can include an <IMG> statement anywhere in formatted text:
- In display text in choice, display, and entry cards
- In choice items on a choice card
The image appears wherever you place the <IMG> statement in the text.
The syntax for the <IMG> statement is:
|
Statement
|
Description
|
<IMG
|
Beginning of the image header.
|
ALT=alt_text
|
Text to display if the image can't be displayed (if the phone does not support images or the image content can't be found).
|
SRC=image_url
|
The URL of the image to display. If you specify a valid name for the ICON option, the device ignores this option.
|
ICON=icon_name
|
The name of a local image to display. If the UP.Browser cannot find the image in ROM, it retrieves it from the UP.Link server.
See the HDML Language Reference for a list of the icon names you can specify for this option.
|
>
|
|
Supported image formats and sizes
The UP.Link and UP.SDK 3.1 releases support only the 1-bit BMP image format. It is up to the HDML service to ensure that images fit on the device display. For information on determining a device's display size, see Retrieving subscriber, device, and UP.Link information. Images that are too large for the display (but still within the maximum deck size) are cropped by the device.
Example of images in choice entries
The following HDML deck uses images in both display and choice cards (see Figure 4-1).
<-- Note: this is not the most efficient way to display -->
<-- multiple images. See the following section for a -->
<-- better method. -->
<HDML VERSION=3.0 PUBLIC=TRUE>
<DISPLAY NAME=a>
<ACTION TYPE=ACCEPT TASK=GO DEST=#b>
Welcome to Kurt Weather<BR>
<IMG SRC=http://www.my.com/weather/splash.bmp
ALT=Kurt Weather Logo>
</DISPLAY>
<CHOICE NAME=b>
Choose a forecast:
<CE TASK=GO DEST=#a>
<IMG SRC=http://www.my.com/weather/rainy.bmp>
Monday
<CE TASK=GO DEST=#a>
<IMG SRC=http://www.my.com/weather/sunny.bmp>
Tuesday
</CHOICE>
</HDML>
FIGURE 4-1.
Images in display and choice cards
Example of images in softkey labels
The following HDML deck illustrates all three ways you can use images in a card:
- In simple display text (
logo.bmp)
- In choice entries (
dollarsign and newpaper icons)
- In softkey labels (
righthand icon)
The interface created by this deck is shown in Figure 4-2.
<HDML VERSION=3.0 PUBLIC=TRUE>
<CHOICE KEY=where>
<ACTION TYPE=ACCEPT ICON=righthand
TASK=GO DEST=$where>
<IMG SRC="../images/logo.bmp" ALT="Uplanet">
<CE VALUE="finance.hdml">
<IMG ICON="dollarsign"><TAB>Finance
<CE VALUE="news.hdml">
<IMG ICON="newspaper"><TAB>News
</CHOICE>
</HDML>
FIGURE 4-2.
Images in display and choice cards
IMPORTANT
Because the SOFT1 and SOFT2 function keys do not have default labels, you must specify the LABEL option within your <ACTION> statement if you use an image for either of these keys. The UP.Browser will use this label if it cannot find the image you specify.
[Cover] [Previous Section] [Next Section] [Index]
Current chapter: Using Images in HDML
Section 30 out of 67 total sections
, Section 2 out of 3 sections in this chapter
Copyright © 1999, Unwired Planet, Inc. All rights
reserved.