locked
Saving Camera Image to WriteableBitmap. Then Saving WriteableBitmap as JPEG to byte array.

    Question

  • Hi all,

    I am developing a small windows 8.1 store app for my business.

    I simply want to be able to save the output of the camera to a WriteableBitmap which I then will allow the user to annotate.

    Once complete I need the edited WriteableBitmap saved as a JPEG to byte array for persistence.

    I am amazed at how tricky this is turning out to be so please can anyone provide sample code for either or both of these steps.

    Many thanks in advance

    Rob

    Tuesday, March 03, 2015 9:57 AM

Answers

  • Hi Rob,

    So you have two questions here:

    #1, How to save Camera image to writeablebitmap

    #2, How to convert image to byte array

    Here is the sample: Capturing and saving images from the camera both for how to save as JPEG also save to local file by byte array.

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Rob Nugent UK Friday, March 06, 2015 4:18 PM
    Wednesday, March 04, 2015 2:08 PM
    Moderator

All replies

  • hi,

    it is simple and i have already did a project and you can download it and look at source code,

    you will find what you want exactly :

    https://gallery.technet.microsoft.com/WPF-Application-to-capture-fd2b5811


    Tuesday, March 03, 2015 10:48 AM
  • this is my application :

    https://gallery.technet.microsoft.com/WPF-Application-to-capture-fd2b5811

    Tuesday, March 03, 2015 10:51 AM
  • Thanks for your reply Imsaiel.

    Unfortunately your project is WPF which uses a very different set of libraries windows 8.1

    Also some features of available in WPF are not available in Windows 8.1

    Kind regards

    Rob

    Tuesday, March 03, 2015 4:36 PM
  • Hi Rob,

    So you have two questions here:

    #1, How to save Camera image to writeablebitmap

    #2, How to convert image to byte array

    Here is the sample: Capturing and saving images from the camera both for how to save as JPEG also save to local file by byte array.

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Rob Nugent UK Friday, March 06, 2015 4:18 PM
    Wednesday, March 04, 2015 2:08 PM
    Moderator
  • James, 

    You are a star.

    Thanks for pointing me in the right direction.

    Can a I ask another quick one?

    I also want the user to be able to sign the image.

    Do you know of any good examples for capturing pen/touch movement and writing the result onto the image?

    Kind regards

    Rob

    • Marked as answer by Rob Nugent UK Friday, March 06, 2015 4:21 PM
    • Unmarked as answer by Rob Nugent UK Friday, March 06, 2015 4:22 PM
    Friday, March 06, 2015 4:21 PM