locked
Implement Barcode Reader with Camera API for Windows 8.1 Project

    Question

  • I am writing to ask if there are any C# / Xaml code samples for working with the Windows Store Camera API to implement a barcode scanner - without requiring the User to take a picture;

    Any insight, guidance is appreciated;


    robert hellestrae

    Tuesday, May 20, 2014 7:32 PM

Answers

  • You can use the MediaCapture API to monitor the camera and take a picture programmatically. See Quickstart: capturing video by using the MediaCapture api (photo's essentially the same) and the Media capture sample

    If you just need a still you can get the encoded file. If you want to examine the video stream live you'll need to drop down to C++ and write a media extension. See the Media extensions sample

    There are also third party libraries which implement barcode scanning that you might want to look at.

    • Marked as answer by rrobhelle Thursday, May 22, 2014 8:55 PM
    • Unmarked as answer by rrobhelle Thursday, May 22, 2014 8:55 PM
    • Marked as answer by rrobhelle Thursday, May 22, 2014 9:54 PM
    Tuesday, May 20, 2014 8:32 PM
    Owner

All replies

  • You can use the MediaCapture API to monitor the camera and take a picture programmatically. See Quickstart: capturing video by using the MediaCapture api (photo's essentially the same) and the Media capture sample

    If you just need a still you can get the encoded file. If you want to examine the video stream live you'll need to drop down to C++ and write a media extension. See the Media extensions sample

    There are also third party libraries which implement barcode scanning that you might want to look at.

    • Marked as answer by rrobhelle Thursday, May 22, 2014 8:55 PM
    • Unmarked as answer by rrobhelle Thursday, May 22, 2014 8:55 PM
    • Marked as answer by rrobhelle Thursday, May 22, 2014 9:54 PM
    Tuesday, May 20, 2014 8:32 PM
    Owner
  • Update:  changing mediaCaptureMgr.SetPreviewMirroring(true), to  mediaCaptureMgr.SetPreviewMirroring(false) resolved issue;

    Thank you for the feedback;

    Working with the ZXing.Net library, and a Windows 8 demo sample, I am able to implement a barcode reader from within a Windows 8 project - without requiring the User to manually take a picture of the barcode;

    During a run of the Visual Studio solution from my laptop, the process works great;

    However, after deploying the Windows 8 app to a Dell Venue Pro device - the following error results:

    "The current capture sink configuration does not support mirroring (Exception from HRESULT:0xC00DABE2)"

    Can this type of issue be related to the Dell Venue Pro device, or most likely related to the application?

    Thanks in advance for any insight, guidance; 

    Update:  changing mediaCaptureMgr.SetPreviewMirroring(true), to  mediaCaptureMgr.SetPreviewMirroring(false) resolved issue;


     

    robert hellestrae


    • Edited by rrobhelle Thursday, May 22, 2014 9:53 PM Update
    Thursday, May 22, 2014 9:08 PM