try www.acme.com
at the bottom of the page you should find a link that reads Gif encoder.

This Gif encoder allows you to create and alter existing GIFs dynamically.

An example below reads an existing image - in this example a image of a
house - and prints SOLD over the image and saves it under a new filename  as
(old filename)+New.gif.

there are commercially available packages that draw graphs. visit for more
info. http://www.ve.com/javachart

good luck.

// Copyright (c) 2000 Your Company
package Test;

/**
 * Test.Test
 * <P>
 * @author Your Name
 */
 import java.awt.*;
 import java.io.*;
 import java.util.*;
 import Acme.JPM.Encoders.GifEncoder;

 public class Test {

 public Frame frame = null;
 public Graphics g = null;


  /**
   * Constructor
   */
  public Test() {
     frame = new Frame();
     frame.addNotify();
  }

  public void merge(String file, String word) {
   try {
     MediaTracker mt = new MediaTracker(frame);
     Image image = Toolkit.getDefaultToolkit().getImage(file);

     mt.addImage(image, 0);

     try {
        mt.waitForAll();
     }
     catch(InterruptedException e) {
        e.printStackTrace();
     }

     //construct a matching-off screen graphics context
     int w = image.getWidth(frame);
     int h = image.getHeight(frame);

     Image offscreen = frame.createImage(w, h);
     g = offscreen.getGraphics();

     //draw the image to the off-screen graphics context
     g.drawImage(image,0,0,frame);

     //write SOLD over the image
     g.setFont(new Font("Monospaced", Font.CENTER_BASELINE | Font.BOLD |
Font.ITALIC, 25));
     g.setColor(Color.red);
     g.drawString(word, 0, h/2);

     //encode the offscreen image to a Gif
     File f = new File(file.substring(0, (file.length() -4)) + "New.gif");

     BufferedOutputStream out = null;
      try {
         System.out.println("Gif location: " + file.substring(0,
(file.length() -4)) + "New.gif");

         out = new BufferedOutputStream(new FileOutputStream(f));

      } catch(Exception e) {
      }


     GifEncoder encoder = new GifEncoder(offscreen, out);
     encoder.encode();
    } catch(Exception e) {
    }finally {
       if(g!=null) {
          g.dispose();
       }
    }
  }

 /**
   * main
   * @param args
   */
  public static void main(String[] args) {
     Test t = new Test();
     t.merge("E:\\Program Files\\Oracle\\JDeveloper
3.2\\myclasses\\Test\\deck_m.gif", "  SOLD");
  }


}



----- Original Message -----
From: "Tim Panton" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 07, 2002 9:50 AM
Subject: Re: How to create dynamic graphs on web pages?


> If you know your users will install a plugin, you could use SVG and let
the browser render it.
>
> For the moment, we've ruled that out, and are creating pretty decent
histograms with <div>s in <table>s
> :-)
>
> tim.
> URL: http://www.westpoint.ltd.uk/ - internet recon.
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to