HamGuy
HamGuy

Reputation: 916

switch the cameratype in Windows Phone7

all, as we know, the CameraType property indicates the location of the camera on the device. But when I try to swich the cameratype from Primary to FrontFacing by using the following code, it does not work. After reviewing the MSDN document, I found it was a protected set method. And obviously I have no access permition. Is there any way to do that? Could any one help me? Thanks in advance!

camera.CameraType = CameraType.FrontFacing;

Upvotes: 0

Views: 127

Answers (1)

Madushan
Madushan

Reputation: 7468

It seems like you can't force the camera to a different mode after you initialize it.

Use the constructor of the implementation.

For ex: Constructor of PhotoCamera class

I assume you're trying to create a custom camera app ? or something similar ? If you just want to capture a picture, use Camera Capture Task instead of this. Otherwise your app will fail certification.

If photo capture is not a core feature of your application, consider using the Camera Capture Task to capture photos instead of using the camera APIs directly. Memory allocated for the Camera Capture Task does not count toward total application memory use. This helps minimize your application’s memory use, which is particularly important when your application runs on a 256-MB device. For more information, see Developing for 256-MB Devices and How to: Use the Camera Capture Task for Windows Phone.

Upvotes: 2

Related Questions