0

アプリがあります。これにより、イメージビューの画像がカラーからグレースケールに変更されます。しかし、反対に、グレースケールをカラードに変更したいです。手伝って頂けますか?グレースケールに色付けされたコードがあります:

try {
    ImageView image = (ImageView) findViewById(R.id.imgView);
    Bitmap bMap = mPhoto;
    int width, height;
    height = bMap.getHeight();
    width = bMap.getWidth();
    mPhoto = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
    Canvas canvas = new Canvas(mPhoto);
    Paint paint = new Paint();
    ColorMatrix colorMatrix = new ColorMatrix();
    colorMatrix.setSaturation(0);
    ColorMatrixColorFilter colorMatrixFilter = new ColorMatrixColorFilter(colorMatrix);
    paint.setColorFilter(colorMatrixFilter);
    canvas.drawBitmap(bMap, 0, 0, paint);
    image.setImageBitmap(mPhoto);
} catch (Exception e) { }
4

0 に答える 0