locked
Access Camera Live Image from Shader

    Question

  • Hi,

    i would like to use the current image of the devices back side camera as texture input, but I have no idea how to start.

    Can you give me a hint or a sample?

    Thanks

    Friday, January 4, 2013 3:13 PM

All replies

  • I came up with an idea. We can using CaptureElement control to get the video form camera, and then put it in Canvas, we can add other XAML control in the canvas, for example.

     <Canvas x:Name="previewCanvas1" Width="320"  Height="240" Background="Gray">
                            <Border Width="178" Height="134" BorderThickness="5" Background="Transparent" Canvas.ZIndex="10" BorderBrush="Red" Canvas.Left="73" Canvas.Top="66"/>
                            <CaptureElement x:Name="previewElement1" Width="320" Height="240" Canvas.ZIndex="0" />
                        </Canvas>

    We can based on
    http://code.msdn.microsoft.com/windowsapps/Media-Capture-Sample-adf87622

    Best regards,
    Jesse


    Jesse Jiang
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, January 7, 2013 7:59 AM
    Moderator
  • i think this is not what i wanted.. with shader i mean GPU Shader.. Pixelshader ;)

    Wednesday, January 9, 2013 9:00 AM
  • Hi,

    Maybe you can try "IAdvancedMediaCapture" interface? It looks like you can get a "IMFDXGIDeviceManager" from this interface. You should then be able to call "GetVideoService" to get a handle to a D3D device.

    Please check the detail from this thread
    http://social.msdn.microsoft.com/Forums/en-US/wingameswithdirectx/thread/4604ea00-3941-4e3f-a2b3-7d9e24cc3b77

    Best regards,
    Jesse


    Jesse Jiang
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, January 11, 2013 5:55 AM
    Moderator
  • Thanks,

    i'll have a try and report if it's working as soon as i find some time again ;)

    Saturday, February 2, 2013 3:00 PM
  • can't get it working..
    btw. i'm working c# (mostly)

    found a promising sample:

    http://code.msdn.microsoft.com/windowsapps/Media-extensions-sample-7b466096

    but i found no way to reach a target texture to MTF (but i also think this isn't the way it's intended)

    is there a simpler way to get the data of the current cam image?

    thanks


    • Edited by XnDerKai Wednesday, February 6, 2013 8:40 AM
    Tuesday, February 5, 2013 6:47 PM