我有一个Bitmap对象,我要获得与该对象左右相反的Bitmap对象,不是上下颠倒,怎么办,求助。最好有代码。
------解决方案--------------------
- Java code
bitmap = BitmapFactory.decodeResource(getResources(), id); int width = bitmap.getWidth(); int height = bitmap.getHeight(); Matrix matrix = new Matrix(); matrix.setScale(-1.0f, 1.0f); bitmap.setDensity(160); bitmap = Bitmap.createBitmap(bitmap, 0, 0, width, height, matrix, true); BitmapDrawable bitmapDrawable = new BitmapDrawable(bitmap);