Image Restrictions

In addition to the specified limits that are set by the WBMP specification from the WAP Forum, other restrictions affect a developers ability to use images within a WML deck.

According to the WAP Forum, the <img> tag can only be used within a paragraph of text. This means that it cannot be used as a soft key label or within a <option> element.

Tip

By using the Phone.com DTD, you can use images within an <option> statement on Phone.com UP.Browser devices that support images.


Aside from the limitations imposed by the WML DTD, some devices further restrict how images will render on the screen. Currently no devices respect the align attribute. The align attribute of the <p> tag which encloses the image can be used to align the graphic left, right, or center on the Phone.com WAP browser. However, The Nokia 7110 and Ericsson R320 will always center an image, regardless of the align property.

The other major limitation of delivering images to a WAP phone is the size of the image. There are no WAP devices on the market today which support packet reassembly. This means that your image must fit within a single packet to arrive at the device.

Not only are you constrained by the sheer number of bytes that you can deliver in a single packet (which varies from 1,461 bytes on the Nokia 7110 to 1,800 bytes on the Phone.com WAP Browser, to 3,000 bytes on the Ericsson R320), but you are also limited by the physical size of the screen. Furthermore, most of today's WAP devices only scroll vertically, not horizontally, so images will be cropped on the left, right, or both edges, depending on the device, if they exceed the maximum pixel width for the phone. Widths of the display on WAP devices today vary, but in general, phones have a width of something near 40 pixels across. Phones with the UP.Browser will communicate the width of the screen to your application in an HTTP Header HTTP_X_UP_DEVCAP_SCREENPIXELS. When the UAProfile specification from the WAP Forum is supported in real devices, screen pixel information will be delivered via that mechanism.

Caution

As stated earlier, animated images are not yet part of the specifications from the WAP Forum. Chapter 9, "Using WMLScript," provides an example of animation which uses a series of images coupled with WMLScript, and a timer element. This is not a very efficient method of animation, but it does work.


Tip

When you are using images on a card that also contains a timer element, be certain that your timer waits long enough for your image to load before advancing to the next screen.


Some WAP devices and WAP Gateways will perform on-the-fly conversion of some formats into the WBMP format specified by the WAP Forum, but other devices will not perform such a conversion. For example, the UP.Link WAP Gateway from Phone.com will convert a one-bit BMP image into a WBMP image automatically, and the Mitsubishi Trium phone will convert a GIF image into a one-bit WBMP image for display. However, it is unwise to rely on these types of conversions, and as a rule of thumb, only WBMP images should be used.

Perhaps the most common use of images on the Web today is as an imagemap, providing a graphical interaction layer with a user. Today, due to limitations in the WAP specifications, and how the user interface works on most WAP-enabled devices, imagemaps are not currently possible. Images can be used as a link within an anchor; however, on some devices, only the alt text will render when this is finished.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.191.22