/**
* JeruGraphics v 1.0.
*
*Some examples of dynamic image generation are as follows:ServletCompleted,
*In addition, the program is very long and does not think it is too good in terms of practicality or readability.
*The code segment is provided here. The command line generates an image file. Is this easier to use?
*
*CreateBufferedImageObject"Image"Put it in this buffer,
*Open another file, encode the image stream, and input the file.
* JpgThe file appears. Try again...
*
* Mender:
* Jeru Liu
* Homepage:
* Http://javaren.126.com
* Email: jeru@163.net
*
*This is just an example Program,It is of great reference value.
*
*/
Import java. io .*;
Import java. util .*;
Import com.sun.image.codec.jpeg .*;
Import java. awt. image .*;
Import java. awt .*;
Public class jeruGraphics {
BufferedImage image;
//CreateJpgFile to the specified path
Public void createJpg (String path ){
Try {
FileOutputStream fos = new FileOutputStream (path );
BufferedOutputStream bos = new BufferedOutputStream (fos );
Required imageencoder encoder = required codec. createJPEGEncoder (bos );
Encoder. encode (image );
Bos. close ();
} Catch (FileNotFoundException fnfe ){
System. out. println (fnfe );
} Catch (IOException ioe ){
System. out. println (ioe );
}
}
Public static void main (String [] args ){