Example usage for java.awt Graphics drawImage

List of usage examples for java.awt Graphics drawImage

Introduction

In this page you can find the example usage for java.awt Graphics drawImage.

Prototype

public abstract boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer);

Source Link

Document

Draws as much of the specified image as is currently available.

Usage

From source file:Main.java

public void paint(Graphics g) {
    Image img = createImage();
    g.drawImage(img, 20, 20, Color.RED, this);
}