Exemplo n.º 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));
 }
Exemplo n.º 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));
 }
Exemplo n.º 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()));
 }
Exemplo n.º 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()));
 }
Exemplo n.º 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));
 }
Exemplo n.º 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));
 }
Exemplo n.º 7
0
 public void loadBasicBitmap() {
   CloseableReference<Bitmap> bitmapRef = mBitmapFactory.createBitmap(mOriginalBitmap);
   setImageBitmap(bitmapRef);
   checkValid(bitmapRef, Bitmap.createBitmap(mOriginalBitmap));
 }