Search Unity

Make a screenshot with my current holograms / unity ui and the "real world" in background

Discussion in 'VR' started by LR-Developer, May 18, 2017.

  1. LR-Developer

    LR-Developer

    Joined:
    May 5, 2017
    Posts:
    109
    Hello,

    I created a small unity app that Shows some meshes / holograms in a Scene (using unity 5.6.1f1).

    I want to create a screenshot / snapshot from what I see when I start my app with the hololens: the holograms from my app and also the photo of the real world I just see.

    How do I do that?

    I started here with the Microsoft / unity sample:
    https://developer.microsoft.com/en-us/windows/mixed-reality/locatable_camera_in_unity

    and followed the sample to "Capture a Photo to a File"

    It says "Saved photo to disk" but I do not see the photo in the Gallery of the hololens?
    Did it really work? Where can I see my photo?

    I gave up and tried this one found in the Forums here:
    https://forum.unity3d.com/threads/holographic-photo-blending-with-photocapture.416023/

    but I cannot get it to work. Or at least it says "Took Picture" and I see some Picture or is it still my tool?
    Parts are missing now, like having a cube before it now only see some single triangles, it is half the cube...is that the taken photo?

    And it does not seem to store something. How can I?

    Can anybody help? Thanks a lot! :)
     
  2. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
    The easiest way is to connect via the device portal. On your device go to Settings / Updates and For Developers. Scroll down and enable the device portal. You'll have to set a username and password the first time. Also, go to the Windows Store and download the remote holographic app on your device (you'll probably need to search). That'll show you the IP address of your device. Then you can just do: https://192.168.0.xxx or whatever the ip address is and login. You can also download a certifcate and install it into your trusted root certificate authorities store so you won't need to enter the username / password.

    Once you're in the remote portal you can take mixed reality photos and video. Also, as a bonus, once you have remoting setup you can also deploy to / debug to your device from Visual Studio by selecting "Remote Machine" and entering the IP Address instead of tethering with a USB cable, giving you a little more freedom when deploying.
     
    LR-Developer likes this.
  3. LR-Developer

    LR-Developer

    Joined:
    May 5, 2017
    Posts:
    109
    Thanks for the answer! That may also be helpful.

    But I would like to make mixed reality snapshots / "screenshots" with my unity app.

    Have what I see on a png / jpg with holograms and real Environment.
     
  4. KarlosZafra

    KarlosZafra

    Joined:
    Sep 8, 2016
    Posts:
    18
    Press the two buttons on the right and the HoloLens will save a screenshot that you can access from the device portal. You can also use voice commands, try "Cortana, take a picture"
     
    LR-Developer likes this.
  5. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
    Oh you want the user to be able to do it. I'm not positive what the API is but I think you can access the camera just like on a mobile device. not sure if you can just take a mixed reality snap or not but I don't see why not.
     
  6. KarlosZafra

    KarlosZafra

    Joined:
    Sep 8, 2016
    Posts:
    18
    Check out this section from the manual: https://docs.unity3d.com/ScriptReference/VR.WSA.WebCam.PhotoCapture.html
     
    Dustin-Horne and LR-Developer like this.
  7. LR-Developer

    LR-Developer

    Joined:
    May 5, 2017
    Posts:
    109
    Thanks a lot for your Infos! Those were helpful now I got everything I need :)
     
    Dustin-Horne likes this.
  8. wassxDyna

    wassxDyna

    Joined:
    Aug 17, 2017
    Posts:
    3
    BTW: making screenshots with the two volume buttons allows you to sync the screenshots via the onedrive app ;)