Example #1
0
 public void loadScaledBitmap(int finalWidth, int finalHeight) {
   CloseableReference<Bitmap> bitmapRef =
       mBitmapFactory.createScaledBitmap(mOriginalBitmap, finalWidth, finalHeight, true);
   setImageBitmap(bitmapRef);
   checkValid(
       bitmapRef, Bitmap.createScaledBitmap(mOriginalBitmap, finalWidth, finalHeight, true));
 }
Example #2
0
 public void loadTranslatedBitmap(int x, int y, int width, int height, int tx, int ty) {
   Matrix matrix = getMatrix(tx, ty, 1, 1, 0);
   CloseableReference<Bitmap> bitmapRef =
       mBitmapFactory.createBitmap(mOriginalBitmap, x, y, width, height, matrix, true);
   setImageBitmap(bitmapRef);
   checkValid(bitmapRef, Bitmap.createBitmap(mOriginalBitmap, x, y, width, height, matrix, true));
 }
Example #3
0
 public void loadFromCroppedColorArray(int x, int y, int width, int height) {
   int[] pixels = new int[width * height];
   mOriginalBitmap.getPixels(pixels, 0, width, x, y, width, height);
   CloseableReference<Bitmap> bitmapRef =
       mBitmapFactory.createBitmap(pixels, width, height, mOriginalBitmap.getConfig());
   setImageBitmap(bitmapRef);
   checkValid(bitmapRef, Bitmap.createBitmap(pixels, width, height, mOriginalBitmap.getConfig()));
 }
Example #4
0
 public void loadFromColorArray() {
   int[] pixels = new int[mOriginalWidth * mOriginalHeight];
   mOriginalBitmap.getPixels(pixels, 0, mOriginalWidth, 0, 0, mOriginalWidth, mOriginalHeight);
   CloseableReference<Bitmap> bitmapRef =
       mBitmapFactory.createBitmap(
           pixels, mOriginalWidth, mOriginalHeight, mOriginalBitmap.getConfig());
   setImageBitmap(bitmapRef);
   checkValid(
       bitmapRef,
       Bitmap.createBitmap(pixels, mOriginalWidth, mOriginalHeight, mOriginalBitmap.getConfig()));
 }
Example #5
0
 public void loadTransformedBitmap(int x, int y, int width, int height, Matrix matrix) {
   CloseableReference<Bitmap> bitmapRef =
       mBitmapFactory.createBitmap(mOriginalBitmap, x, y, width, height, matrix, true);
   setImageBitmap(bitmapRef);
   checkValid(bitmapRef, Bitmap.createBitmap(mOriginalBitmap, x, y, width, height, matrix, true));
 }
Example #6
0
 public void loadCroppedBitmap(int x, int y, int width, int height) {
   CloseableReference<Bitmap> bitmapRef =
       mBitmapFactory.createBitmap(mOriginalBitmap, x, y, width, height);
   setImageBitmap(bitmapRef);
   checkValid(bitmapRef, Bitmap.createBitmap(mOriginalBitmap, x, y, width, height));
 }
Example #7
0
 public void loadBasicBitmap() {
   CloseableReference<Bitmap> bitmapRef = mBitmapFactory.createBitmap(mOriginalBitmap);
   setImageBitmap(bitmapRef);
   checkValid(bitmapRef, Bitmap.createBitmap(mOriginalBitmap));
 }