svoid bwCopy(BufferedImage src, BWImage dst, int dstX, int dstY) { bwCopy(new BWImage(src), dst, dstX, dstY); } svoid bwCopy(BWImage src, BWImage dst, int dstX, int dstY) { int w = dst.getWidth()-dstX; int h = dst.getHeight()-dstY; w = min(w, src.getWidth()); h = min(h, src.getHeight()); for (int y = 0; y < h; y++) for (int x = 0; x < w; x++) dst.setInt(dstX+x, dstY+y, src.getInt(x, y)); }