QR code scanning from desktop

Has anyone tried to capture a QR code from a desktop/laptop’s camera?
Maybe this can be done with a plugin?

You can do this with MBS. Look into it sample code : ‘Live Barcode Detection with Vision’

2 Likes

Though this was posted in the “General” section and I think the Vision framework is macOS specific.

I knew I had a routine somewhere for this. This is also MBS but works on both macOS and Windows (never tried on Linux)

Public Function searchImageForBarcode(pict as picture) As string
  dim res as string
  dim resultZxing as zxingResultMBS
  dim binBitmap as zxingBinaryBitmapMBS
  dim xQrReader as new zxingQRCodeReaderMBS
  dim decHints as new zxingDecodeHintsMBS(zxingDecodeHintsMBS.DefaultHint )
  
  decHints.TryHarder = true
  
  Try
    #Pragma BreakOnExceptions false
    binBitmap = zxingBinaryBitmapMBS.CreateWithPicture( pict )
    
    resultZxing = xQrReader.decode( binBitmap, decHints )
    if resultZxing <> nil then
      res = resultZxing.Text
    end if
  Catch
  end Try
  
  return res
  
End Function

It will return the text of a QR if it finds one in the image.

Edit: Added function definition

Edit 2: I guess this does not directlly answer the OP’s question. It finds a QR code within an image, not a live camera feed. So you’d have to wrap this in something grabbing frames and processing them.

ideally it will be cross-platform, but I’ll take what I can. Thanks.

I have the liberty of implementing the workflow anyway I want. I can force it to take a picture first.