首 页WAP教程WAP源码WAP电子书客户留言龙腾电脑维修网158网络电视本站论坛繁體中文
设为首页
加入收藏
联系我们
您当前的位置:WAP开发网 -> WAP教程 -> 综合杂谈 -> 文章内容 退出登录 用户管理
栏目导航
· ASP WAP开发教程 · ASP.net WAP开发教程
· PHP WAP开发教程 · WML教程
· JSP开发WAP教程 · WAP 2.0
· 综合杂谈
热门文章
· WAP 2.0教程
· WML语言基础(WAP建站...
· 用VS2005实现ASP.NE...
· [组图] php WAp开发教程
· WML语言基础(WAP建站...
· VS.NET 2003开发移动...
· [图文] ASP技术进行动态WAP...
· [图文] WML语言基础(WAP建站...
· asp.net移动控件开发...
· [图文] 创建移动Web应用程序...
相关文章
· PHP开发WAP常见问题...
· WAP常见问题问答大全...
· WAP常见问题问答大全...
· WAP常见问题问答大全...
· WAP常见问题问答大全...
· WAP常见问题问答大全...
· WAP常见问题问答大全...
· WAP常见问题问答大全...
· WAP常见问题问答大全...
WAP常见问题问答大全---五、关于WBMP的常见问答
作者:不详  来源:不详  发布时间:2006-2-23 14:14:04  发布人:tangyunfei

减小字体 增大字体


如何创建WBMP?
哪种格式的图像可以放送到WAP终端?
    如果某个WAP设备可以支持任何图像格式,那么WBMP Type 0是最小的要求。
有GIF/JPEG 到WBMP的转换器吗?
有没有实时转换GIF到WBMP的工具?
    PBMtoWBMP:http://www.looplab.com/WAP/tools/
可以在WAP页面中混合声音和文本吗?
有一个WBMP图片在Nokia Toolkit上能正常运行,但是在Nokia 7110上却不能是为什么?
当使用WBMP作为超链接等时,在7110模拟器上不工作,为什么?
设备可以使用图形而不是文本吗?
    因为不是所有的WAP设备都能显示图像。因此,<img>中的“alt”必须使用,这样才能适用于那些不能显示图像的WAP设备。
    “WAP Tiger”是一个非常简单的命令行BMP转换工具,可以去http://wap.infotiger.de/download.html下载。有 MS-DOS/Windows 和 Linux 版本。
    可以在http://www.rcp.co.uk/distributed/Downloads找到免费的Photoshop/Paint Shop Pro插件。
    Macromedia 有一个为 Fireworks的外接插件可以让用户输出WBMPs。PC版本在:
        http://download.macromedia.com/pub/fireworks/xtras/wbmp_im_ex.exe
    Mac 版本在:
        http://download.macromedia.com/pub/fireworks/xtras/wbmp_im_ex.hqx
    它能让你通过手工草稿生成、上传并编辑WBMP。如果只有服务器端的脚本语言程序,但是无法产生动态的WBMP,这是唯一的选择。
    在http://www.gingco.de/wap/有一个免费的PIC2WBMP “独立”转换器。但是这个应用需要Java 运行环境。因此如果是个新手的话,最好是下载Paint Shop Pro 插件和最新的 Paint Shop Pro,网址是:
    http://www.jasc.com/download.html
    Paint Shop Pro 对于没有注册的用户来说是有时间限制的SW。注册费用是 $99 USD 。
    Surerange Analysis Ltd 有一个免费的产品叫做ImageConvert Developer。它是一个单线程的ActiveX控件,可以将GIF和JPEG转换成WBMP。它同样有一个VC6的例子来说明如何使用。
    Applepie Solutions 提供一个在线的,基于WEB的GIF到WBMP的转换:
    http://www.applepiesolutions.com/image2.wbmp/
    如果指定用户想转换的文件的URL地址,它将让用户下载转换后的文件。
    在某些情况下用户想在HTML文档中显示WBMP。为了达到这个目的,Andre de Leiradella (leiradella@writeme.com) 已经写了一个Java和C程序来从WBMP输出GIF,看起来就好像一个小的LCD显示器。C版本可以作为CGI。应用程序可以到下面的位置找到:
    http://members.xoom.com/leiradel/。
如何实现动画?
    http://wap.colorline.no/demos.html
    或者到:
    http://wap.colorline.no/wap-faq/apps/anim.html
    当在执行这样的动画方式的时候,要记住微型浏览器的内存是有限制的。不可能将所有的图片都装入到内存中。浏览器也不会装入那些过大的图片,因此某些动画可能在装入的时候就中断了。
    演示程序:
  "http://www.wapforum.org/DTD/wml_1.1.xml">
  <!-- Code written in Microsoft NOTEPAD.EXE. (c) Espen Lyngaas 2000 Color Line ASA -->
  <wml>
    <card id="image1" ontimer="#image2">
      <timer value="10"/>
      <p>
        <img src="anim1.wbmp" alt="Anim1"/>
      </p>
    </card>
    <card id="image2" ontimer="#image3">
      <timer value="10"/>
      <p>
        <img src="anim2.wbmp" alt="Anim2"/>
      </p>
    </card>
    <card id="image3" ontimer="#image4">
      <timer value="10"/>
      <p>
        <img src="anim3.wbmp" alt="Anim3"/>
      </p>
    </card>
    <card id="image4" ontimer="#end">
      <timer value="10"/>
      <p>
        <img src="anim4.wbmp" alt="Anim4"/>
      </p>
    </card>
    <card id="end" title="The End">
      <p>
         This is the end of the animation, but you can
         <anchor>run it again.
           <go href="#image1">
           </go>
         </anchor>
      </p>
    </card>
  </wml>
    echo("<?xml version=\"1.0\"?>\n");
    echo("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"
\"http://www.wapforum.org/DTD/wml_1.1.xml\">\n\n");
    echo("<!-- Code written in Microsoft NOTEPAD.EXE. (c) Espen Lyngaas 1999 Color Line ASA -->\n");
  ?>

<wml>

  <?
    for($card=1;$card<5;$card++) {
      echo("<card id=\"image".$card."\" ontimer=\"#image".$card+1.">"\n");
      echo("<timer value=\"10\"/>\n");
      echo("<p>\n");
      echo("<img src=\"anim".$card.".wbmp\" alt=\"Anim".$card."\"/>\n");
      echo("</p>\n");
      echo("</card>\n");
    }
  ?>
  <card id="image5" title="The End">
  <p>
    This is the end of the animation, but you can
    <anchor>run it again.
      <go href="#image1">
      </go>
    </anchor>
  </p>
  </card>
  </wml>
如果WBMP图片看起来糟糕极了,该怎么办?

能够生成动态的WBMP图像吗?
    因为当前版本的GD不再创建GIF图像,而是称作PNG (Portable Network Graphics)图像。所以使用当前版本的PHP,只需要修改少量的代码就可以将GIF 转换到 PNG。另外,可以用“DuPont’s Image Magick ”将PNG 或者转换成 WBMP,它能在两者之间相互转换,并适合于多种平台。
    在代码里,笔者用到了PHP功能 ImageCreateFromGif(),要输一些文本到GIF图像上,可以使用PHP的 ImageGreate()创建一个空白的 GIF/PNG 图像。
    以下是代码:
// path to blank GIF file – not really needed (see above)
    $blank = "./wapclock_blank.gif";
// You can look at it here
// path to input file generated by PHP
    $input = "/tmp/wapclock.gif";
// path to temporary output file. Extension is irrelevant
    $output = "/tmp/wapclock.out";
// path to ImageMagick convert
    $convert = "/usr/local/bin/convert";
    if($format == "gif") {
// if it’s GIF, send that Content-type
       header("Content-type: image/gif");
       $type = "GIF";
    }
    else {
      if($format == "wbmp") {
// if it’s WBMP, send that Content-type
        header("Content-type: image/vnd.wap.wbmp");
        $type = "WBMP";
      }
      else {
   // hope that the browser can read this
        header("Content-type: text/plain");
   // or someone forgot to set the format variable
        $type = "";
      }
    }
  // turn off caching
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    header("Cache-Control: no-cache, must-revalidate");  
    header("Pragma: no-cache");
 
// create a GIF file from an empty GIF file (see faq)
    $im = imagecreatefromgif($blank);

// put the current time into the time variable
    $time = date("H:m:s");

// Place time variable sort of in the middle, with font size 4
    imagestring($im,4,6,15,$time,0);
// generate a GIF file with PHP (see faq)
    ImageGif($im,$input);
// empty the GD temporary buffer
    ImageDestroy($im);

    if(strlen($type) > 0) {
// if the type is known
// do the conversion
      exec($convert. " ".$input. " ".$type. ":".$output);
    }
    else {
// or do nothing
      echo("Unknown format!\n");
// and stop
      exit;
    }
 // open the converted file
    $fd = fopen($output, "r");
// read verything into a variable
    $contents = fread($fd,filesize($output));
// close the file
    fclose($fd);
// pour out the contents
    echo($contents);
  ?>
    echo("<?xml version=\"1.0\"?>\n");
    echo("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"
\"http://www.wapforum.org/DTD/wml_1.1.xml\">\n\n");
    echo("<!—Code written in Microsoft NOTEPAD.EXE. (c) Espen Lyngaas 2000 Color Line ASA à \n");
 ?>

  <wml>
    <card id="wapclock" title="WAP Clock">
      <do type="prev" label="Reload Image">
        <go href="<?echo($PHP_SELF)?> "/>
      </do>
      <p>
        <img src="http://wap.colorline.no/wap-faq/apps/gfxclock.html?format=wbmp"
alt="You should see an image…"/>
      </p>
    </card>
  </wml>
针对多大的屏幕进行开发?
    Ed Chew(Ed.Chew@scoot.co.uk) 检验过 “R380 Design Guideline for WAP Services”, 并且发现在Ericsson R380 有 360x120 像素的分辨率 (83x28mm),  0.23点距,浏览区域是限制在310(宽),100(高) pixels ,包括顶部的两个像素的空格,左边和右边的三个像素的空格,因此实际上只有304 x 98 像素。
    为了弄清显示器到底有多大的大小,在http://wap.colorline.no/demos.html (选择 “Resolution matrix”)有一个分辨矩阵的演示程序。 页面将显示三个不同大小的图像,一个垂直和一个水平,它们是一个方向上十个像素,另外一个方向上只有一个像素,这样你马上就能知道屏幕到底有多大。另外他们的大小是:80x80,100x100 和 120x120像素,因为有些浏览器不能装载那些过大的图片。
    由于有些显示器的点是长方形的,而不是正方形的,所以开发人员需要重新影射图像,让他们看起来像正方形,圆看起来像圆。但笔者不推荐这个方法,除非你知道用户所使用的WAP设备的真正比例。一个在7110上看起来很好的图到了R380上会很糟糕。
在WML中可以预先装入图片吗?
    在下面的例子中,可能需要改变一下timer的数值,让它有时间来装入图片。
    <!-- Adjust this timer to taste. -->
    <timer value="10"/>
      <p align="center">
        <img src="spacer1.wbmp" alt="x"/>
      </p>
      <p>
        <img src="1.wbmp" alt="1"/>
      </p>
      <p>
        <img src="2.wbmp" alt="2"/>
      </p>
      <p>
        <img src="3.wbmp" alt="3"/>
      </p>
      <p>
        <img src="4.wbmp" alt="4"/>
      </p>
      <p>
        <img src="5.wbmp" alt="5"/>
      </p>
    </card>

    <card id="f1" ontimer="#f2">
      <timer value="10"/>
      <p align="center">
        <img src="spacer15.wbmp" alt="x"/>
      </p>
      <p align="center">
        <img src="1.wbmp" alt="1"/>
      </p>
    </card>

    <card id="f2" ontimer="#f3">
      <timer value="10"/>
      <p align="center">
        <img src="spacer10.wbmp" alt="x"/>
      </p>
      <p align="center">
        <img src="2.wbmp" alt="2"/>
      </p>
    </card>

    <card id="f3" ontimer="#f4">
      <timer value="10"/>
      <p align="center">
        <img src="spacer08.wbmp" alt="x"/>
      </p>
      <p align="center">
        <img src="3.wbmp" alt="3"/>
      </p>
    </card>

    <card id="f4" ontimer="#f5">
      <timer value="10"/>
      <p align="center">
        <img src="4.wbmp" alt="4"/>
      </p>
    </card>

    <card id="f5" ontimer="#f1">
      <timer value="10"/>
      <p align="center">
        <img src="5.wbmp" alt="5"/>
      </p>
    </card>
  </wml>
为什么有些WBMP无法显示?
[] [返回上一页] [打 印] [收 藏]
∷相关文章评论∷    (评论内容只代表网友观点,与本站立场无关!) [更多评论...]
关于本站 - 网站帮助 - 广告合作 - 下载声明 - 友情连接 - 网站地图 - 管理登录
Copyright © 2002-2005 wapkf.com. All Rights Reserved .
浙ICP备06013604号|站长QQ:274273595