Closed xjrcode closed 10 years ago
Done!
I wish this helps to someone.
Bitmap bMap = MediaStore.Images.Media.getBitmap(getActivity().getContentResolver(), selectedImage);
int[] intArray = new int[bMap.getWidth()*bMap.getHeight()];
//copy pixel data from the Bitmap into the 'intArray' array
bMap.getPixels(intArray, 0, bMap.getWidth(), 0, 0, bMap.getWidth(), bMap.getHeight());
LuminanceSource source = new RGBLuminanceSource(bMap.getWidth(), bMap.getHeight(), intArray);
BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));
Reader reader = new MultiFormatReader();
Result result = reader.decode(bitmap);
There is any way to read an image from disk?
I have this code working on other project with zbar, but I don't find the way to do this with your project.