Select default camera in custom layout in Zxing
up vote
0
down vote
favorite
I am using ZXing
to scan barcode in a Xamarin Forms
app in a custom layout. How can I select the default camera as front camera. Their is no option to select the default camera.
<zxing:ZXingScannerView Grid.Row="1" x:Name="_scanView" OnScanResult="Handle_OnScanResult" IsScanning="true" WidthRequest="200" HeightRequest="200" />
xamarin.forms zxing
add a comment |
up vote
0
down vote
favorite
I am using ZXing
to scan barcode in a Xamarin Forms
app in a custom layout. How can I select the default camera as front camera. Their is no option to select the default camera.
<zxing:ZXingScannerView Grid.Row="1" x:Name="_scanView" OnScanResult="Handle_OnScanResult" IsScanning="true" WidthRequest="200" HeightRequest="200" />
xamarin.forms zxing
Why would you want to use the front camera?
– Tom
2 days ago
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am using ZXing
to scan barcode in a Xamarin Forms
app in a custom layout. How can I select the default camera as front camera. Their is no option to select the default camera.
<zxing:ZXingScannerView Grid.Row="1" x:Name="_scanView" OnScanResult="Handle_OnScanResult" IsScanning="true" WidthRequest="200" HeightRequest="200" />
xamarin.forms zxing
I am using ZXing
to scan barcode in a Xamarin Forms
app in a custom layout. How can I select the default camera as front camera. Their is no option to select the default camera.
<zxing:ZXingScannerView Grid.Row="1" x:Name="_scanView" OnScanResult="Handle_OnScanResult" IsScanning="true" WidthRequest="200" HeightRequest="200" />
xamarin.forms zxing
xamarin.forms zxing
asked 2 days ago
Ashish Kumar
17611
17611
Why would you want to use the front camera?
– Tom
2 days ago
add a comment |
Why would you want to use the front camera?
– Tom
2 days ago
Why would you want to use the front camera?
– Tom
2 days ago
Why would you want to use the front camera?
– Tom
2 days ago
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
You can do it in the Options
which is of type MobileBarcodeScanningOptions
. That has a property called UseFrontCameraIfAvailable
.
To set it from code, do this: _scanView.Options = new MobileBarcodeScanningOptions { UseFrontCameraIfAvailable = true; }
From XAML is a bit more extensive but not undoable:
<zxing:ZXingScannerView Grid.Row="1" x:Name="_scanView" OnScanResult="Handle_OnScanResult" IsScanning="true" WidthRequest="200" HeightRequest="200">
<zxing:ZXingScannerView.Options>
<zxcore:MobileBarcodeScanningOptions UseFrontCameraIfAvailable="true" />
</zxing:ZXingScannerView.Options>
</zxing:ZXingScannerView>
You might need to import a different XAML namespace for the options object. I don't have an actual project at hand to try, but I'm sure you will figure that one out.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
You can do it in the Options
which is of type MobileBarcodeScanningOptions
. That has a property called UseFrontCameraIfAvailable
.
To set it from code, do this: _scanView.Options = new MobileBarcodeScanningOptions { UseFrontCameraIfAvailable = true; }
From XAML is a bit more extensive but not undoable:
<zxing:ZXingScannerView Grid.Row="1" x:Name="_scanView" OnScanResult="Handle_OnScanResult" IsScanning="true" WidthRequest="200" HeightRequest="200">
<zxing:ZXingScannerView.Options>
<zxcore:MobileBarcodeScanningOptions UseFrontCameraIfAvailable="true" />
</zxing:ZXingScannerView.Options>
</zxing:ZXingScannerView>
You might need to import a different XAML namespace for the options object. I don't have an actual project at hand to try, but I'm sure you will figure that one out.
add a comment |
up vote
1
down vote
You can do it in the Options
which is of type MobileBarcodeScanningOptions
. That has a property called UseFrontCameraIfAvailable
.
To set it from code, do this: _scanView.Options = new MobileBarcodeScanningOptions { UseFrontCameraIfAvailable = true; }
From XAML is a bit more extensive but not undoable:
<zxing:ZXingScannerView Grid.Row="1" x:Name="_scanView" OnScanResult="Handle_OnScanResult" IsScanning="true" WidthRequest="200" HeightRequest="200">
<zxing:ZXingScannerView.Options>
<zxcore:MobileBarcodeScanningOptions UseFrontCameraIfAvailable="true" />
</zxing:ZXingScannerView.Options>
</zxing:ZXingScannerView>
You might need to import a different XAML namespace for the options object. I don't have an actual project at hand to try, but I'm sure you will figure that one out.
add a comment |
up vote
1
down vote
up vote
1
down vote
You can do it in the Options
which is of type MobileBarcodeScanningOptions
. That has a property called UseFrontCameraIfAvailable
.
To set it from code, do this: _scanView.Options = new MobileBarcodeScanningOptions { UseFrontCameraIfAvailable = true; }
From XAML is a bit more extensive but not undoable:
<zxing:ZXingScannerView Grid.Row="1" x:Name="_scanView" OnScanResult="Handle_OnScanResult" IsScanning="true" WidthRequest="200" HeightRequest="200">
<zxing:ZXingScannerView.Options>
<zxcore:MobileBarcodeScanningOptions UseFrontCameraIfAvailable="true" />
</zxing:ZXingScannerView.Options>
</zxing:ZXingScannerView>
You might need to import a different XAML namespace for the options object. I don't have an actual project at hand to try, but I'm sure you will figure that one out.
You can do it in the Options
which is of type MobileBarcodeScanningOptions
. That has a property called UseFrontCameraIfAvailable
.
To set it from code, do this: _scanView.Options = new MobileBarcodeScanningOptions { UseFrontCameraIfAvailable = true; }
From XAML is a bit more extensive but not undoable:
<zxing:ZXingScannerView Grid.Row="1" x:Name="_scanView" OnScanResult="Handle_OnScanResult" IsScanning="true" WidthRequest="200" HeightRequest="200">
<zxing:ZXingScannerView.Options>
<zxcore:MobileBarcodeScanningOptions UseFrontCameraIfAvailable="true" />
</zxing:ZXingScannerView.Options>
</zxing:ZXingScannerView>
You might need to import a different XAML namespace for the options object. I don't have an actual project at hand to try, but I'm sure you will figure that one out.
edited 2 days ago
answered 2 days ago
Gerald Versluis
15.7k43155
15.7k43155
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53372225%2fselect-default-camera-in-custom-layout-in-zxing%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Why would you want to use the front camera?
– Tom
2 days ago