Code for B4A and B4i
B4X:
Sub btnTorch_Click
If Capturing Then
#If B4i
If scanner.TorchMode = scanner.TORCH_OFF Then
scanner.TorchMode = scanner.TORCH_ON
btnTorch.Text = "Torch Off"
Else
scanner.TorchMode = scanner.TORCH_OFF
btnTorch.Text = "Torch On"
End If
#Else If B4A
If camEx.GetFlashMode <> "torch" Then
camEx.SetFlashMode("torch")
camEx.CommitParameters
btnTorch.Text = "Torch Off"
Else
camEx.SetFlashMode("off")
camEx.CommitParameters
btnTorch.Text = "Torch On"
End If
#End If
End If
End Sub
[B4X] [B4XPages] Barcode Reader
B4A + B4i barcode reader. Don't miss: - #PlistExtra in B4i. - Manifest code + #AdditionalJar in B4A Depends on BCToast: https://www.b4x.com/android/forum/threads/b4x-bctoast-cross-platform-custom-toast-message.111046/#content (BCToast will be an internal library in the near future) While the...
www.b4x.com
Last edited: