Java GraphicsEnvironment .createGraphics (BufferedImage img)
Syntax
GraphicsEnvironment.createGraphics(BufferedImage img) has the following syntax.
public abstract Graphics2D createGraphics(BufferedImage img)
Example
In the following code shows how to use GraphicsEnvironment.createGraphics(BufferedImage img) method.
/* w w w .j ava 2 s . c o m*/
import java.awt.Graphics2D;
import java.awt.GraphicsEnvironment;
import java.awt.image.BufferedImage;
public class Main {
public static void main(String[] args) {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
BufferedImage bi = new BufferedImage(10, 20, 0);
Graphics2D g2 = ge.createGraphics(bi);
}
}
Home »
Java Tutorial »
java.awt »
Java Tutorial »
java.awt »