4

画像の透明な領域を検出し、2番目の画像を最初の画像のその透明な領域とマージしたい.....androidのjava部分と..

マージ画像のコーディングを行いましたが、最初の画像の透明な領域にマージされていません。

     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;
  }
4

0 に答える 0