Page 114 - DCAP512_WAP_AND_WML
P. 114

WAP & WML




                    Notes                                            Figure  8.1















                                          Example: Examples of WMBP graphics in a WAP application
                                   Images  are added  to the document  with  the <img/> element.  Make sure that it  is  placed
                                   within <p> tags, as shown in this example:
                                   <card>
                                   <p><img src=”logo.wbmp” alt=”Cookbook Logo”></p>
                                   </card>
                                   Some mobile devices have stored in their memory a library of small images that can be placed
                                   in the WML document using  the localsrc attribute in the image tag. The  advantage of local
                                   images is that they reduce the amount of data that needs to be transferred from the server, so
                                   they display more quickly than external WBMP files. It is a good idea also to provide a pointer
                                   to an external graphic in case local images are not supported. The following example requests a
                                   generic credit card icon from  the local image library and specifies an alternative .wbmp file.
                                   The alt text will display on devices that do not support graphics at all.
                                   <img localsrc=”creditcard” src=”card.wbmp” alt=”credit card symbol”>

                                   A complete list of library images and their names is available athttp://developer.phone.com/
                                   htmldoc/41/wmlref/taglist.html#575099.




                                      Task  Analyze the advantages of localscr images in WML with example.
                                   Creating WBMP Graphics: There are few tools available that can create WBMP files at this time.
                                   However, you can download the free  UnWired plug-in  from RCP Distributed Systems that
                                   enables you to create WBMP files in Adobe Photoshop 5 and higher and JASC Paint Shop Pro (or
                                   any  graphics  package  that  supports  plug-ins).  It  is  available  at http://www.rcp.co.uk/
                                   distributed/downloads/.There is also a Java utility called pic_2_wbmp that converts existing
                                   BMP files to WBMP format. It is available at http://www.gingco.de/wap/.

                                   Self Assessment

                                   Fill in the blanks:
                                   6.  No graphic should exceed ……………….. pixels square.
                                   7.  WBMP files are ……………….. graphics capable of displaying only black and white pixels.
                                   8.  You can download the free  ……………….. plug-in from RCP Distributed Systems that
                                       enables you to create WBMP files in Adobe Photoshop 5.
                                   9.  The advantage of local images is that they ……………….. the amount of data that needs to
                                       be transferred from the server, so they display more quickly than external WBMP files.



          108                               LOVELY PROFESSIONAL UNIVERSITY
   109   110   111   112   113   114   115   116   117   118   119