Master
'
s Thesis 2006
FACHHOCHSCHULE
HOCHSCHULE F
U
R
LI Hui
STUTTGART
TECHNIK
The implementation
STUTTGART UNIVERSITY OF APPLIED
SCIENCES
3.7 Raster image viewer development
As described before, PNG is the mostly image format used in mobile device
application. In J2ME, the
Graphics
class provides a method for drawing images, static
image and non static image. Static image can not be modified after been created;
non static image is drawn by the J2ME drawing function. Because the limited process
speed and memory, the PNG map should be created in form of static image. The static
image can be created based on the binary PNG format.
Image img=Image.createImage(byte[], int offset, int length);
Listing 23:
Create static image though binary PNG format.
At first the PNG image data is read though the data stream from WMS, and then puts
the data into one byte buffer. At last the Viewer reads those data from the byte buffer
and paints the image on the screen according to the data.
55,66, 47, 103, 85,105,106, 30,
13,17, 68, 11,88,43,45,13,69,21, 11
, 106,62,4,6, 25,112,62, 4, 28,115,1
21, 67, 128,127, 50,107, 109,78,8,7
, 88,14,108, 74,27, 26,41, 14, 32, 8
3,123, 4, 38, 41,30,112, 21,43,45,1
3,69,21, 82, 63,45,42,73,103, 126,
19, 102,7
Fig. 25:
Read image data as byte array
Similar to SVGT Viewer, the PNG Viewer was developed with such functions, Pan,
Zoom, Orig View, and Help. See Figure 26.
49
PHP MySql Web Hosting Design and Implement Client Applications PHP MySQL Hosting
|
|
|
|
TotalRoute.net Business web hosting division of Vision Web Hosting Inc. All rights reserved. |