I’m writing an augmented reality app for Windows Phone 7 as a school project. I want to get the camera output and then add a layer of data over it. Is there a way to have the camera output displayed in a panel?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
FYI: In Windows Phone SDK 7.1 (a.k.a. “Mango”) you can now write apps that use the device camera as you describe. See App Hub for a link to the latest 7.1 development tools. The documentation describes how to do this at the following link:
How to: Create a Base Camera Application for Windows Phone
But basically, add a videobrush to display the camera feed (a.k.a. the “viewfinder”). For example, here a rectangle control is used display the camera viewfinder:
To use the camera in the code-behind for the page, add a reference to Microsoft.XNA.Framework and put the following Using statements at top of the page:
Note: you may not need all of these, I just copied it from the docs. In Visual Studio (Pro, at least), you can clean them up after you’re done by right-clicking your code file and clicking: Organize Usings | Remove Unused Usings.
Then, basically you apply the camera image to the rectangle in the OnNavigatedTo handler…
…and dispose of the camera object in the OnNavigatingFrom.
The 7.1 docs also describe an augmented reality app in the following topic. Note that you’ll need to scroll-down to the section titled Creating a Silverlight-based Augmented Reality Application, to find the instructions for building it with Mango.
How to: Use the Combined Motion API for Windows Phone
Hope that also helps others seeking information about PhotoCamera in Windows Phone OS 7.1.
Cheers