Code example for Bitmap

Methods: getConfiggetHeightgetWidthisMutable

0
	 
	private static Bitmap getBitmapFromNative(Bitmap bitmap) {
		int width = nativeGetBitmapWidth();
		int height = nativeGetBitmapHeight();
		 
		if (bitmap == null || width != bitmap.getWidth() || height != bitmap.getHeight() || !bitmap.isMutable()) { //in case it was rotated and the dimensions changed
			Config config = Config.ARGB_8888;
			if (bitmap != null) {
				config = bitmap.getConfig();
				bitmap.recycle();
			} 
			bitmap = Bitmap.createBitmap(width, height, config);
		} 
 
		int[] pixels = new int[width];
		for (int y = 0; y < height; y++) {
			nativeGetBitmapRow(y, pixels);
			bitmap.setPixels(pixels, 0, width, 0, y, width, 1);
		} 
				 
Contextual code suggestions in your IDE  Get Codota for Java
10
CodeRank