Java Draw Image drawPixel(int x, int y, Color color, BufferedImage displayMap)

Here you can find the source of drawPixel(int x, int y, Color color, BufferedImage displayMap)

Description

draw Pixel

License

Open Source License

Declaration

public static void drawPixel(int x, int y, Color color, BufferedImage displayMap) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.awt.Color;
import java.awt.image.BufferedImage;

public class Main {
    public static void drawPixel(int x, int y, Color color, BufferedImage displayMap) {
        if (x < 0 || y < 0 || x >= displayMap.getWidth() || y >= displayMap.getHeight()) {
            return;
        }// w  w  w  . j ava  2  s  .  c  om
        displayMap.setRGB(x, y, color.getRGB());
    }
}

Related

  1. drawInMiddle(Graphics g, Image image, String text)
  2. drawLabel(BufferedImage image, String text)
  3. drawNormalImage(Rectangle2D bounds, Graphics2D g2, Image image, ImageObserver observer, int imageWidth, int imageHeight)
  4. drawOnto(final BufferedImage pDestination, final Image pSource)
  5. drawPixel(BufferedImage img, int x, int y, int color)
  6. drawScaledImage(Graphics graphics, BufferedImage image, int x, int y, int w, int h, int left, int right)
  7. drawScaledImage(Image image, Component canvas, Graphics g)
  8. drawSquare(BufferedImage image, int x, int y, int size, int pixel)
  9. drawStretchedImage(Rectangle2D bounds, Graphics2D g2, Image image, ImageObserver observer)