我正在使用一组位图来绘制SurfaceView并开发夜间模式。要打开夜间模式,我只需将所有位图变暗并重绘SurfaceView:
Bitmap newBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(newBitmap);
Paint paint = new Paint();
paint.setColorFilter(new LightingColorFilter(0x808080, 0));
c.drawBitmap(bitmap, 0, 0, paint);
bitmap = newBitmap;
但是当我需要关闭夜间模式时,如何减轻这些位图?