© June 13th, 2004: Author: Rune Henning Johansen, http://rhj.info, rhj@rhj.info. Translator: Jan Egil Kristiansen

WbmpServer; generating WAP Images

Opp
Norge Norsk originalversjon Norge


Introduction

To fit WAP images to different devices, I have made a WbmpServer to: If your WAP screen is small, the image is small. If the screen is large, the image can be as large as you want it. For the time being, the service is adapted to the following devices, or User-Agent s: If you use another device, or feel that your device is improperly supported, please contact me.
Rune Henning Johansen
rhj@rhj.info
+47 22253241, (home phone)
+47 95939001, (cellular)
All use of the service is logged to facilitate adaptation of new devices.


Contributors

The following persons have - more or less - in different ways - contributed to the server.

Usage

We start with the image that is (or was) at:
http://www.cs.ubc.ca/spider/phillips/spock.gif

Spock

The simplest way to present a WAP version of this image, is the following WML code:
<img src="http://rhj.dyndns.info:3333/test.wbmp?adr=www.cs.ubc.ca/spider/phillips/spock.gif" alt="Loading image ..."/>
Depending on the size of your WAP device, the image might be presented like this:
eks-1-basic
The server will accept various arguments. The syntax :
arg=verdi+arg=verdi+...
In addition to adr, the following arguments may be used:
Argument Description Value Default Sample
frame Place a frame around the image false/true false eks-2-ramme
logo present image as logo false/true false eks-3-logo.
random An alternative rastering technique false/true false eks-4-random
faktor Changing the aspect ratio.

May be needed because some
devices have non-square
pixels.

float 1.0 2.0
eks-5-faktor-to

0.5:
eks-6-faktor-halv

mx & my Maximum width and height of image float & float No default. The server will
try to adapt the image with
maximum possible size for
the device. These
arguments may
cause smaller images than
the device screen,
but never larger.
25 & 25:
eks-7-begrenset

Sample Code

If no arguments are given, the server will generate a wml file. This is the code given by a call on: http://rhj.dyndns.info:3333/: The result of http://rhj.dyndns.info:3333/ in WinWAP 2.2:
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
  <template>
    <do type="prev" name="b" label="Tilbake">
      <prev/>
    </do>
  </template>
  <card title="Testbilde">
    <p align="left">
      Kun adressen:<br/>
      <img src="http://rhj.dyndns.info:3333/?adr=www.cs.ubc.ca/spider/phillips/spock.gif"
      alt="Bildet lastes inn ..."/>
    </p>
    <p>
      Med ramme:<br/>
      <img src="http://rhj.dyndns.info:3333/?adr=www.cs.ubc.ca/spider/phillips/spock.gif+ramme=true"
      alt="Bildet lastes inn ..."/>
    </p>
    <p>
      Som logo:<br/>
      <img src="http://rhj.dyndns.info:3333/?adr=www.cs.ubc.ca/spider/phillips/spock.gif+logo=true"
      alt="Bildet lastes inn ..."/>
    </p>
    <p>
      Tilfeldige piksler:<br/>
      <img src="http://rhj.dyndns.info:3333/?adr=www.cs.ubc.ca/spider/phillips/spock.gif+random=true"
      alt="Bildet lastes inn ..."/>
    </p>
    <p>
      Breiflabb:<br/>
      <img src="http://rhj.dyndns.info:3333/?adr=www.cs.ubc.ca/spider/phillips/spock.gif+faktor=2.0"
      alt="Bildet lastes inn ..."/>
    </p>
    <p>
      Lang i maska:<br/>
      <img src="http://rhj.dyndns.info:3333/?adr=www.cs.ubc.ca/spider/phillips/spock.gif+faktor=0.5"
      alt="Bildet lastes inn ..."/>
    </p>
    <p>
      Begrenset st&#248;rrelse:<br/>
      <img src="http://rhj.dyndns.info:3333/?adr=www.cs.ubc.ca/spider/phillips/spock.gif+mx=25+my=25"
      alt="Bildet lastes inn ..."/>
    </p>
    <p align="left">
      <a href="http://geb.nta.no/~rune/wap/pi.wml">Prosjekt I</a><br/>
    </p>
  </card>
</wml>
eks-9x-utsnitt-winwap


Valid HTML 4.01! Valid CSS!
13/6-2004:
?