ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/reports/DBReporter2/IscreamChartWriter.java
Revision: 1.1
Committed: Sat Feb 3 14:56:14 2001 UTC (23 years, 9 months ago) by pjm2
Branch: MAIN
Log Message:
A rewrite of the database reporting tools.  These reflect the new way in
which the database stores the original XML rather than parameter and value
pairs.

File Contents

# User Rev Content
1 pjm2 1.1 import java.io.*;
2     import java.awt.*;
3     import java.awt.image.*;
4     import Acme.JPM.Encoders.*;
5    
6    
7     public class IscreamChartWriter {
8    
9     public IscreamChartWriter() {
10    
11     }
12    
13     public static void writeChart(BufferedImage img, String filename) {
14     try {
15     FileOutputStream fos = new FileOutputStream(new File(filename));
16     GifEncoder encoder = new GifEncoder(img, fos);
17    
18     encoder.encode();
19    
20     fos.flush();
21     fos.close();
22     }
23     catch(Exception e){
24     System.out.println("Could not write the .gif file: " + e);
25     }
26    
27     System.out.println("Wrote " + filename + " successfully.");
28     }
29     }