Java Draw Image drawVerticalLineAt(int x, int dottedLine, Color color, BufferedImage displayMap)

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

Description

draw Vertical Line At

License

Open Source License

Declaration

public static void drawVerticalLineAt(int x, int dottedLine, 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 drawVerticalLineAt(int x, int dottedLine, Color color, BufferedImage displayMap) {
        for (int y = 0; y < displayMap.getHeight(); y += dottedLine) {
            drawPixel(x, y, color, displayMap);
        }/*from   w w w .  j av  a 2 s  .com*/
    }

    public static void drawPixel(int x, int y, Color color, BufferedImage displayMap) {
        if (x < 0 || y < 0 || x >= displayMap.getWidth() || y >= displayMap.getHeight()) {
            return;
        }
        displayMap.setRGB(x, y, color.getRGB());
    }
}

Related

  1. drawSquare(BufferedImage image, int x, int y, int size, int pixel)
  2. drawStretchedImage(Rectangle2D bounds, Graphics2D g2, Image image, ImageObserver observer)
  3. drawTiledImage(Rectangle2D bounds, Graphics2D g2, Image image, ImageObserver observer, int imageWidth, int imageHeight, int tilePadding)
  4. drawTransparentImageInOval(Graphics2D gr, Image img, Rectangle r, boolean noShrink, double transparency)
  5. drawVerticalBar(final BufferedImage image, final double max, final double min)
  6. drawVolatileImage(Graphics2D g, VolatileImage volatileImage, int x, int y, Image orig)