2013.05.26 02:07


public Bitmap mergeBitmap(Bitmap src, Bitmap mergeBitmap) {
int width = src.getWidth();
int height = src.getHeight();

mergeBitmap2 = Bitmap.createScaledBitmap(mergeBitmap, width,
height, true);

int maskPixel;int tilePixel;int mergedPixel;
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
maskPixel = mergeBitmap2.getPixel(x, y);
tilePixel = src.getPixel(x, y);

mergedPixel = Color.argb(Color.alpha(maskPixel),
Color.red(maskPixel), Color.green(maskPixel),
Color.blue(maskPixel));

mergeBitmap2.setPixel(x, y, mergedPixel);

mergedPixel = Color.argb(Color.alpha(tilePixel),
Color.red(tilePixel), Color.green(tilePixel),
Color.blue(tilePixel));

mergeBitmap2.setPixel(x, y, mergedPixel);
}
}

return mergeBitmap2;

신고


Posted by injunech