The following forum(s) have migrated to Microsoft Q&A (Preview): Developing Universal Windows apps!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

 locked
Use Photo from Photo Chooser as an Texture2D on a fbx Model RRS feed

  • Question

  • hi, I am currently working in a mixed Silverlight/XNA App, and I tried to select a photo by using the integrated OhotoChooserTask and then convert the image to Texture2D. I want to use the Texture2D on a fbx Model. But when I try to access the memoryStream an create the Texture2D I receive the exception: "This XNA Framework graphic operation is not valid when Silverlight rendering is active. To use XNA Framework graphics, call Graphics.SetDirectRenderingMode(true); I also disabled SharingMode from my graphicdevice, but this is not the solution.
    Wednesday, January 4, 2012 8:40 PM

All replies

  • hi,

    when you called the PhotoChooserTask your application will pushed in the background and the XNA rendering will be disabled.
    You have to wait until your OnNavigatedTo method is called and the XNA rendering is enabled again after finishing the task, before you create the Texture.

    Regards,
    Nick
    Thursday, May 10, 2012 6:10 AM
  • If you want to do rendering in ChooserTaskCompleted event just put in

     SharedGraphicsDeviceManager.Current.GraphicsDevice.SetSharingMode(true);

    and then do your rendering

    Monday, December 10, 2012 3:20 PM