Order the Book

coreservlets
Class MessageImage

java.lang.Object
  |
  +--coreservlets.MessageImage

public class MessageImage
extends Object

Utilities for building images showing shadowed messages. Includes a routine that uses Jef Poskanzer's GifEncoder to return the result as a GIF.

Does not run in JDK 1.1, since it relies on Java2D to build the images.

Taken from Core Servlets and JavaServer Pages from Prentice Hall and Sun Microsystems Press, http://www.coreservlets.com/. © 2000 Marty Hall; may be freely used or adapted.


Constructor Summary
MessageImage()
           
 
Method Summary
static Image makeMessageImage(String message, String fontName, int fontSize)
          Creates an Image of a string with an oblique shadow behind it.
static void sendAsGIF(Image image, OutputStream out)
          Uses GifEncoder to send the Image down output stream in GIF89A format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageImage

public MessageImage()
Method Detail

makeMessageImage

public static Image makeMessageImage(String message,
                                     String fontName,
                                     int fontSize)
Creates an Image of a string with an oblique shadow behind it. Used by the ShadowedText servlet and the ShadowedTextFrame desktop application.

sendAsGIF

public static void sendAsGIF(Image image,
                             OutputStream out)
Uses GifEncoder to send the Image down output stream in GIF89A format. See http://www.acme.com/java/ for the GifEncoder class.

Order the Book

Order
CSAJSP @ amazon.com

Return to Top-Level Source Code Archive