WML cards can contain images. In the early days, WAP-enabled wireless devices only supported the Wireless Bitmap (WBMP) image format. WBMP images can only contain two colors: black and white. Also, WBMP is not a compressible format, since the processor of wireless devices in the old days did not have enough computation power and decompression would result in a long delay. The file extension and the MIME type of WBMP are ".wbmp" and "image/vnd.wap.wbmp" respectively.
To draw WBMP images, a WBMP image editor is needed. The Nokia Mobile Internet Toolkit comes with a WBMP image editor that you can use. Besides drawing WBMP images, you can use it to convert other image formats to WBMP. Just open a GIF or JPG image file with the editor and it will be converted automatically. Free tools such as ImageMagick can also do such kind of thing. However, remember that WBMP images can only contain black and white colors, which means there will have detail loss during the conversion of a colorful image to the WBMP format.
A WML browser can display color images if the image format used is supported by the wireless device. Currently, most mobile phone models on the market have color screens and support color images. Commonly supported image formats are GIF 87a, GIF 89a (animated GIF), JPG and PNG. Note that the image formats supported are device-specific. Some wireless devices can only support a subset of the above image formats.
One simple way to find out whether a particular image format can be displayed on a WML browser is to check the accept HTTP header, like what we have done in the "Choosing MIME Types Dynamically" section of our XHTML MP tutorial. For example, if "image/gif", "image/jpg" and "image/png" are found in the accept HTTP header, it means the WML browser can display the GIF, JPG and PNG image formats.
|Previous Page||Page 12 of 50||Next Page|
- 1. WML (Wireless Markup Language) Introduction
- 2. WML Deck and Card
- 3. WML Document Structure
- 4. WML Generic Metadata: <meta>
- 5. Comments in WML
- 6. Line Breaking in WML
- 7. Font Size and Style in WML
- 8. WML Preformatted Text: <pre>
- 9. WML Images
- 10. WML Tables
- 11. WML Anchor Links
- 12. Programming Softkeys of Mobile Phones and the <do> Element
- 13. WML Template and Menu
- 14. WML Events and the <onevent> Tag
- 15. Timer and the ontimer Event
- 16. WML Event: onenterbackward
- 17. WML Event: onenterforward
- 18. WML Selection Lists and the onpick Event
- 19. WML Input Fields
- 20. WML Variables
- 21. Submitting Form Data to the Server in WML
- 22. Clearing a Saved Form in WML