Images

You can also display images in WMF, but there's a catch. Images must be in special WBMP format, and that format doesn't exactly permit the rich depth of colors you may be used to. In fact, WBMP format is black and white with no grayscalejust 1 bit per pixel. Here are some WBMP resources available online:

  • www.phnet.fi/public/jiikoo/ WAPDraw, a useful WBMP drawing program.

  • www.teraflops.com/wbmp An online converter that converts image files to WBMP files with a few simple clicks. Any HTML browser can download the resulting images, unless the browser understands WBMP format, in which case the image will be displayed.

  • http://www.hicon.nl/cgi-bin/library/clipart/clipart.pl A WBMP clip art library.

To display images, you probably won't be surprised to learn that WML has an <img> element. You set the alt , src , width , and height attributes of this element to display images; here's an example:

Listing ch20_19.wml
 <?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 2.0//EN"     "http://www.wapforum.org/dtd/wml20.dtd" > <wml>     <card id="Card1" title="Images">         <p align="center"><b>Images</b></p>         <p align="center">  <img alt="WML Image"   src="ch20_20.wbmp" width="217" height="164"/>  </p>     </card> </wml> 

You can see this WML document, along with a WBMP image I created for it to display, ch20_20.wbmp, in Figure 20-18.

Figure 20-18. Displaying an image.

graphics/20fig18.gif

That's it for our exploration of WMLand XML. We've come far in this book, from the very beginning up through valid and well- formed documents, DTDs, schemas, how to parse XML with JavaScript, data binding, CSS, XML and Java, DOM and SAX parsers, XSL transformations, XSL formatting objects, XLinks, XPointers, XHTML, RDF, SOAP, VML, and now WML and XML with JSP, ASP, Java servlets, and Perl. All that remains now is for you is to put all this incredible amount of technology to work for yourself.



Real World XML
Real World XML (2nd Edition)
ISBN: 0735712867
EAN: 2147483647
Year: 2005
Pages: 440
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net