0

I was wondering if it's possible open camera inside a small piece of screen from a custom xaml page. I'm not sure if WP7 API support stuff like that.

Version: Windows Phone 7.5 Mango

Paul Annetts
  • 9,554
  • 1
  • 27
  • 43
Daniel
  • 455
  • 4
  • 14
  • To avoid bickering in the answers below could you please specify what version of Windows Phone you are targetting? WP7.0 or WP7.5 "Mango"? – Paul Annetts Feb 09 '12 at 16:40
  • Should the exact tag used here matter? Would anyone want to target pre-Mango WP7? http://stackoverflow.com/questions/9215203/is-there-any-point-in-writing-pre-mango-7-0-windows-phone-7-applications – ColinE Feb 09 '12 at 16:59
  • @ColinE :). I've retagged with both tags now the question text is explicit to keep everyone happy. – Paul Annetts Feb 09 '12 at 17:03

1 Answers1

2

You can use the camera as a live source of image data in your application. This is well documented in the Code Samples for Windows Phone MSDN page. The demo code produces a simple application as follows:

enter image description here

You simply create a brush in XAML:

<VideoBrush x:Name="viewfinderBrush" />

And wire it up to your camera in code-behind:

 viewfinderBrush.SetSource(cam);
ColinE
  • 68,894
  • 15
  • 164
  • 232
  • 2
    For that is for what version? All users on Mango now, so `windows-phone-7` tag means Mango by default. Also, you don't need to support 7.0 now, I guess – Ku6opr Feb 09 '12 at 16:15
  • No Windows-Phone-7 means WP7 (original) Windows-Phone-7.1 and Windows-Phone-7.5 means Mango – MyKuLLSKI Feb 09 '12 at 16:21