ach.image.png
Class PngToolkit

java.lang.Object
  extended byach.image.png.PngToolkit

public class PngToolkit
extends java.lang.Object

Wrapper class that retrieves an PNG image through a PNGImageProducer class. This wrapper is designed to work hand in hand with a Java-PNGImageProducer class published by Jason Marshall on 14 May 1997 as beta version 0.88, who granted the permission to use, reproduce, modify and/or (re)distribute his software. These classes can be found in several sources on the Internet.

The two static methods provided by this class expect either a String giving the pathname of a local image file or its URL and will return an ImageProducer.

The author makes no representations or warranties regarding the suitability, reliability or stability of this code. This code is provided AS IS. The author shall not be liable for any damages suffered as a result of using, modifying or redistributing this software or any derivitives thereof.


Constructor Summary
PngToolkit()
           
 
Method Summary
static java.awt.image.ImageProducer getImageProducer(java.lang.String name)
          Retrieve an ImageProducer for a PNG from a local file.
static java.awt.image.ImageProducer getImageProducer(java.net.URL context)
          Retrieve an ImageProducer given just a PNG URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PngToolkit

public PngToolkit()
Method Detail

getImageProducer

public static java.awt.image.ImageProducer getImageProducer(java.lang.String name)
                                                     throws java.awt.AWTException
Retrieve an ImageProducer for a PNG from a local file.

Parameters:
name - contains the file name.
Returns:
an ImageProducer
Throws:
java.awt.AWTException - on stream or bitmap data errors

getImageProducer

public static java.awt.image.ImageProducer getImageProducer(java.net.URL context)
                                                     throws java.awt.AWTException
Retrieve an ImageProducer given just a PNG URL.

Parameters:
context - contains the base URL (from getCodeBase() or such)
Returns:
an ImageProducer
Throws:
java.awt.AWTException - on stream or bitmap data errors