我有一個的兩個圖像的一個圖像由包含身體無面和一個圖像包含僅臉...合併兩個圖像(一幅圖像是無面透明的,第二圖像是從SD卡來唯一面)
現在我想合併這兩個圖像....只包含身體沒有臉在面對的是透明的第一圖像.....
那麼,如何可以檢測透明區域和地方的臉在那裏在透明區域?
我結合了下面的代碼兩幅圖像..但不要把臉上掠過透明區域下方
我的代碼被賦予適當的方式,
public Bitmap combineImages(Bitmap c, Bitmap s) {
Bitmap cs = null;
int width, height = 0;
if (c.getWidth() > s.getWidth()) {
width = c.getWidth() + s.getWidth();
height = c.getHeight();
} else {
width = s.getWidth() + s.getWidth();
height = c.getHeight();
}
cs = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
Canvas comboImage = new Canvas(cs);
comboImage.drawBitmap(c, 0f, 0f, null);
comboImage.drawBitmap(s, 0f, 0f, null);
return cs;
}