[mapserver-users] Another mapplet PNG question

Woody Wallace wgwallace at students.wisc.edu
Mon Jun 11 12:27:16 EDT 2001


Rob,

We have sucessfully migrated our applet (not mapplet, but similar is some
respects) to use the sixlegs PNG code.  It handles the images in a slightly
different manner than the way java natively handles jpg and gif.  For instance,
we had to switch to double buffering in order to alleviate flicker when drawing
a zoom box.

Here is a segment of our source code that: 1) creates a URL, 2) passes the URL
as an argument to the sixlegs code and creates a PngImage, 3) creates an image
java can use from the PngImage.

//get map image
        try {
            imgurl = new URL(urlstring);
//            System.err.println(urlstring);
       } catch(MalformedURLException e) {}
        try {
        PngImage png = new PngImage(imgurl);
        img = Toolkit.getDefaultToolkit().createImage(png);
        } catch (IOException e) { System.err.println(e); }
    }


Good luck.

Woody



Robert Chavez wrote:

> I'm in the process of applying the sixlegs PNG loading classes to Steve's
> mapplet and I'm having a little trouble getting everything to work properly.
> I was wondering if anyone had any luck integrating  the mapplet with either
> sixlegs or another image I/O library for PNG loading.
>
> I'd prefer to stay away from the native PNG support in Java 1.3, 1.4 as I
> don't want users to have to download a java plugin to use the interactive
> atlas on our web site.
>
> Thanks,
> Rob Chavez
> ***********************************************
> Robert Chavez
> Programmer, GIS Specialist
> Perseus Project
> Tufts University
> Department of Classics
> 124 Eaton Hall
> Medford, MA 02155
>
> Tel:  617-627-3830
> Fax:  617-627-3032
> Email:  rchavez at perseus.tufts.edu
> Web:  www.perseus.tufts.edu




More information about the mapserver-users mailing list