Currently, I am working on an upgrade from a WP7 app where I use barcode scanning.
As the flash is not controllable enough on the Microsoft.Devices.PhotoCamera object,
I want to try using the AudioVideoCaptureDevice. This device includes the VideoTorch, so flash can be on constantly in stead of flashing when trying to focus.
I want to get an image from the previewbuffer by using this code:
Windows.Foundation.Size res = AudioVideoCaptureDevice.GetAvailablePreviewResolutions(CameraSensorLocation.Back).First();
this.CaptureDevice = await AudioVideoCaptureDevice.OpenForVideoOnlyAsync(CameraSensorLocation.Back, res);
CaptureDevice_PreviewFrameAvailable(ICameraCaptureDevice sender, object args)
int frameWidth = (int)this.CaptureDevice.PreviewResolution.Width;
int frameHeight = (int)this.CaptureDevice.PreviewResolution.Height;
int ARGBPx = new int[frameWidth * frameHeight];
So, now I have an array of integers containing the ARGB values from the preview frame.
How can I let the BarcodeReader find a barcode in this array? The Decode method has an overload where you can place a byte array with raw RGB data. Also need a RGBLuminanceSource.BitmapFormat then.
Please be so kind to advice me on this.