You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use ZXingScannerView to scan a QR Code, but althought on many devices I have tested the camera works fine (both Portrait & Landscape), in one specific device the Video from camera stream is always rotated 90 degrees. I tried set "TryHarder" property to true or false, but nothing changes.
Here is a sample code.
In code behind I initialize ZXingScannerView:
private void InitializeBarcodeCameraView {
if (_viewModel != null) {
_scanView = new ZXingScannerView() {
IsScanning = true,
IsAnalyzing = true,
WidthRequest = 300,
IsVisible = true,
Options = _viewModel.UseBackCamera,
};
_scanView.OnScanResult += Camera_OnScanResult;
}
}
and at ViewModel I also initialize UseBackCamera property as follows:
UseBackCamera = new MobileBarcodeScanningOptions() {
UseFrontCameraIfAvailable = false,
};
where,
public MobileBarcodeScanningOptions UseBackCamera {
get { return _useBackCamera; }
set {
_useBackCamera = value;
RaisePropertyChanged(nameof(UseBackCamera));
}
}
I tried in code behind to set "Rotation" property for example 90 degrees with no result, as the only thing that rotates is ZXingScannerView and not the camera stream video itself.
Is there any "best practice" to set for example a property to force the rotation of video stream (in degrees) for the problematic specific device, without configuring the native library (I need to use the nuget package instead)?
The text was updated successfully, but these errors were encountered:
I use ZXingScannerView to scan a QR Code, but althought on many devices I have tested the camera works fine (both Portrait & Landscape), in one specific device the Video from camera stream is always rotated 90 degrees. I tried set "TryHarder" property to true or false, but nothing changes.
Here is a sample code.
In code behind I initialize ZXingScannerView:
private void InitializeBarcodeCameraView {
if (_viewModel != null) {
_scanView = new ZXingScannerView() {
IsScanning = true,
IsAnalyzing = true,
WidthRequest = 300,
IsVisible = true,
Options = _viewModel.UseBackCamera,
};
_scanView.OnScanResult += Camera_OnScanResult;
}
}
and at ViewModel I also initialize UseBackCamera property as follows:
UseBackCamera = new MobileBarcodeScanningOptions() {
UseFrontCameraIfAvailable = false,
};
where,
public MobileBarcodeScanningOptions UseBackCamera {
get { return _useBackCamera; }
set {
_useBackCamera = value;
RaisePropertyChanged(nameof(UseBackCamera));
}
}
I tried in code behind to set "Rotation" property for example 90 degrees with no result, as the only thing that rotates is ZXingScannerView and not the camera stream video itself.
Is there any "best practice" to set for example a property to force the rotation of video stream (in degrees) for the problematic specific device, without configuring the native library (I need to use the nuget package instead)?
The text was updated successfully, but these errors were encountered: