Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.
Options

How do I load a texture (no Unity)

How do I load a texture from the "file system" (not sure I can access the file system) for hololens. Not using Unity.

Ie, when I'm deploying my application from Visual Studio, where would I put the texture file or any file for that matter, and how would I reference / access / load that texture? What does the "deploy" functionality copy over to the device?

I need to load text files too.

Thanks.

Answers

  • Options

    Does this help?
    Quickstart: Local app data (XAML)
    In conjunction with the, Supported API list.

  • Options

    here's a little snippit, following the same pattern as loading a shader in the DX template:

    task<std::vector<byte>> loadTextureTask = DX::ReadDataAsync(L"ms-appx:///moon.jpg");
        loadTextureTask.then([this](const std::vector<byte>& textureData)
        {
            WCHAR msg[255];
            swprintf_s(msg, L"tds: %d\n", textureData.size());
            OutputDebugString(msg);
        });
    

    Obviously I'm not doing anything useful with the texture aside from ensuring that the byte count matched.

    ===
    This post provided as-is with no warranties and confers no rights. Using information provided is done at own risk.

    (Daddy, what does 'now formatting drive C:' mean?)

  • Options

    Also don't forget to make sure the texture is included in your project as "Content" in the properties window. Use the relative path to get the correct path, however the above code works just fine.

    Dwight Goins
    CAO & Founder| Independent Architect | Trainer and Consultant | Sr. Enterprise Architect
    MVP | MCT | MCSD | MCPD | SharePoint TS | MS Virtual TS |Windows 8 App Store Developer | Linux Gentoo Geek | Raspberry Pi Owner | Micro .Net Developer | Kinect For Windows Device Developer
    http://dgoins.wordpress.com

Sign In or Register to comment.