PhotoCamera Class
July 26, 2012
Provides the basic camera functionality for a Windows Phone still camera application. This class includes members for enabling and configuring functionality such as image capture, focus, resolution, and flash mode. Also, it provides events for camera focus, image capture, and image availability.
Assembly: Microsoft.Phone (in Microsoft.Phone.dll)
XMLNS for XAML: Not mapped to an xmlns.
The PhotoCamera type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | PhotoCamera() | Initializes a new instance of the PhotoCamera class. |
![]() | PhotoCamera(CameraType) | Initializes a new instance of the PhotoCamera class for the specified type of camera. |
| Name | Description | |
|---|---|---|
![]() | AvailableResolutions | Queries the camera for the available resolutions. (Inherited from Camera.) |
![]() | CameraType | Gets the type of camera that the Camera object represents; indicates the location of the camera on the device. (Inherited from Camera.) |
![]() | FlashMode | Gets or sets the flash mode. Unsupported flash modes silently default to Off. |
![]() | InternalLock | This member is for internal use only. (Inherited from Camera.) |
![]() | IsFocusAtPointSupported | Specifies whether the camera can programmatically auto focus on a specific point in the viewfinder. |
![]() | IsFocusSupported | Specifies whether the camera can be auto-focused programmatically. |
![]() | Orientation | Gets the number of degrees that the viewfinder brush needs to be rotated clockwise to align with the camera sensor. (Inherited from Camera.) |
![]() | PreviewResolution | Gets the current resolution of the image provided by the PhotoCameraGetPreviewBuffer methods. This method is for use by the live viewfinder. (Inherited from Camera.) |
![]() | Resolution | Gets or sets the resolution of the image captured by the camera. (Inherited from Camera.) |
![]() | SequenceNumber | This member is for internal use only. (Inherited from Camera.) |
![]() | YCbCrPixelLayout | Gets the YCbCr pixel layout of the camera preview buffer. |
| Name | Description | |
|---|---|---|
![]() | CancelFocus | Cancels the current focus operation. |
![]() | CaptureImage | Initiates a full-resolution capture of the current image displayed in the viewfinder. |
![]() | Dispose | Disposes of the image source stream and frees resources used by the Camera object. (Inherited from Camera.) |
![]() | Equals | (Inherited from Object.) |
![]() | Finalize | Releases unmanaged resources and performs other cleanup operations before the Camera object is reclaimed by garbage collection. (Inherited from Camera.) |
![]() | Focus | Starts a camera auto focus operation. |
![]() | FocusAtPoint | Starts a camera auto focus operation on a specific point in the viewfinder, for those devices that support it. |
![]() | GetHashCode | (Inherited from Object.) |
![]() | GetPreviewBufferArgb32 | Copies the current viewfinder ARGB frame into a buffer for further manipulation. |
![]() | GetPreviewBufferY | Copies the luminance data for the current viewfinder frame into a buffer for further manipulation. |
![]() | GetPreviewBufferYCbCr | Copies the current viewfinder frame into a buffer for further manipulation. |
![]() | GetType | (Inherited from Object.) |
![]() | InvokeAndRemapExceptions | This member is for internal use only. (Inherited from Camera.) |
![]() | IsFlashModeSupported | Determines whether a particular flash mode is supported on the device. |
![]() | MemberwiseClone | (Inherited from Object.) |
![]() | SafeFireEvent(EventHandler) | This member is for internal use only. (Inherited from Camera.) |
![]() | SafeFireEvent<T>(EventHandler<T>, T) | This member is for internal use only. (Inherited from Camera.) |
![]() | ToString | (Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() | AutoFocusCompleted | Occurs after the focus operation is complete. |
![]() | CaptureCompleted | Occurs when the capture sequence is complete. |
![]() | CaptureImageAvailable | Occurs when an image is available. |
![]() | CaptureStarted | Occurs when the capture sequence has started. |
![]() | CaptureThumbnailAvailable | Occurs when a thumbnail image is available. |
![]() | Initialized | Occurs when the camera object has been initialized. (Inherited from Camera.) |
To account for the Windows Phone execution model, initialize the PhotoCamera object in the OnNavigatedTo(NavigationEventArgs) method and explicitly call the camera Dispose method during the OnNavigatingFrom(NavigatingCancelEventArgs) method. Add event handlers for PhotoCamera and CameraButtons events in the OnNavigatedTo(NavigationEventArgs) method and remove them in the OnNavigatingFrom(NavigatingCancelEventArgs) method.
For examples and more information about how to implement these members, see How to: Create a Base Camera Application for Windows Phone.
Note: |
|---|
|

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