KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > snow > utils > gui > ImageUtils


1 package snow.utils.gui;
2
3 import java.awt.*;
4 import java.awt.geom.*;
5 import java.awt.image.*;
6 import javax.imageio.*;
7
8
9 public class ImageUtils
10 {
11
12   public ImageUtils()
13   {
14
15   } // Constructor
16

17
18   public static BufferedImage convertToBufferedImage(Image im)
19   {
20     BufferedImage bim = new BufferedImage(im.getWidth(null), im.getHeight(null), BufferedImage.TYPE_INT_ARGB);
21     Graphics2D g2 = bim.createGraphics();
22     g2.drawImage(im,0,0,null);
23     return bim;
24   }
25
26
27 } // ImageUtils
Popular Tags