Ask Your Question

Revision history [back]

After converting image to bitmap, image doesn't displayed

When I'm trying to convert the Mat image to Bitmap the image doesn't displayed in my device, on the contrary when I use Bitmap.Config.RGB_565 the displayed image is black. Here is my code:

Mat src = new Mat(bmp.getHeight(), bmp.getWidth(), CvType.CV_8UC1);
    imgToProcess = Utils.bitmapToMat(bmp, src);

    Bitmap bmpOut = Bitmap.createBitmap(imgToProcess.cols(), imgToProcess.rows(), Bitmap.Config.ARGB_8888);
    Utils.matToBitmap(imgToProcess, bmpOut);