Java examples for 2D Graphics:BufferedImage Paint
draw Borders BufferedImage
//package com.java2s; import java.awt.Color; import java.awt.image.BufferedImage; public class Main { public static void drawBorders(BufferedImage imageBorders, int[][] differentialIntMatrix, int width, int height, int threshold, Color borderColor) { for (int i = 0; i < width - 1; i++) { for (int j = 0; j < height - 1; j++) { boolean isBorder = differentialIntMatrix[i][j] > threshold ? true : false;/*from w w w . j av a 2s . com*/ if (isBorder) { //System.out.println("\nBlue: "+borderColor.getBlue()+"\nGreen: "+borderColor.getGreen()+"\nRed: "+borderColor.getRed()+"\n"); imageBorders.setRGB(i, j, imageBorders.getRGB(i, j) + borderColor.getRGB()); } } } } }