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