Java Draw Image drawSquare(BufferedImage image, int x, int y, int size, int pixel)

Here you can find the source of drawSquare(BufferedImage image, int x, int y, int size, int pixel)

Description

draw Square

License

Open Source License

Declaration

private static void drawSquare(BufferedImage image, int x, int y, int size, int pixel) 

Method Source Code

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

import java.awt.image.BufferedImage;

public class Main {
    private static void drawSquare(BufferedImage image, int x, int y, int size, int pixel) {
        for (int px = 0; px < size; ++px) {
            for (int py = 0; py < size; ++py) {
                image.setRGB(x + px, y + py, pixel);
            }/* w w w  .  j  a v a 2 s. com*/
        }
    }
}

Related

  1. drawOnto(final BufferedImage pDestination, final Image pSource)
  2. drawPixel(BufferedImage img, int x, int y, int color)
  3. drawPixel(int x, int y, Color color, BufferedImage displayMap)
  4. drawScaledImage(Graphics graphics, BufferedImage image, int x, int y, int w, int h, int left, int right)
  5. drawScaledImage(Image image, Component canvas, Graphics g)
  6. drawStretchedImage(Rectangle2D bounds, Graphics2D g2, Image image, ImageObserver observer)
  7. drawTiledImage(Rectangle2D bounds, Graphics2D g2, Image image, ImageObserver observer, int imageWidth, int imageHeight, int tilePadding)
  8. drawTransparentImageInOval(Graphics2D gr, Image img, Rectangle r, boolean noShrink, double transparency)
  9. drawVerticalBar(final BufferedImage image, final double max, final double min)