0

I am getting Barcode(com.google.android.gms.vision.barcode) object from a physical sales card via camera. Is there a way to convert it back to a image using gms:play-services-vision library?

Cœur
  • 32,421
  • 21
  • 173
  • 232
Vasile Doe
  • 1,434
  • 1
  • 18
  • 35

2 Answers2

0

I think you will get barcode value in a string. you may try to below code

TextView tv = (TextView)findViewById(R.id.textview);
tv.setText(bitmapstring);
tv.buildDrawingCache();
ImageView img = (ImageView)findViewById(R.id.imageview);
img.setImageBitmap(tv.getDrawingCache());
ketan muttha
  • 226
  • 1
  • 4
0

Seems like there's no way of doing that by using the play-services-vision library. My first thought would be to take a screen capture of the preview of the camera before actually reading the barcode, but let's suppose you cannot do that.

If you have the actual data and the format of the barcode you can use ZXing to generate back the barcode image.

Here's an example of how to do it: Generate barcode image in Android application

mikehc
  • 807
  • 8
  • 19