Java examples for 2D Graphics:Color RGB
filter RGB
//package com.java2s; public class Main { public static boolean filterRGB(double margin, int imgWt, int imgHt, int icol, int irow) { if (margin <= 0.0) return true; double fadeWt = margin * imgWt, fadeHt = margin * imgHt; double newWt = (double) imgWt - fadeWt, newHt = (double) imgHt - fadeHt;/* w ww.ja v a2 s.co m*/ double dxFade = fadeWt / 2.0D, dyFade = fadeHt / 2.0D; if ((irow > dyFade && icol > dxFade) && (irow < (dyFade + newHt) && icol < (dxFade + newWt))) return false; return true; } }