BitmapFactory null issue in android
问题 I am trying to create bitmap class using bitmapfactory. I get camera preview image in YUV format and decode manually to grayscale image. When i try to create bitmap object via BitmapFactory it returns null. try { for (int y = 0; y < frameHeight; y++){ for (int x = 0; x < frameWidth; x++){ byte grey = YUVData[y * frameWidth + x]; convertedData[y * stride + 3 * x] = grey; convertedData[y * stride + 3 * x + 1] = grey; convertedData[y * stride + 3 * x + 2] = grey; } } Bitmap bitmap =(Bitmap)