All docs
V21.2
21.2
21.1
20.2
20.1
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

TakePictureDialog Class

The modal dialog to take pictures from a camera device.

Namespace: DevExpress.XtraEditors.Camera

Assembly: DevExpress.XtraEditors.v21.2.dll

Declaration

public class TakePictureDialog

Remarks

Use the Take Picture dialog to allow users to take pictures from an attached camera device in a modal dialog. This dialog contains an embedded Camera Control.

CameraControl - Capture Dialog New

When a user captures an image and clicks the Save button, the image is saved to the TakePictureDialog.Image property.

The following code shows a TakePictureDialog and then saves the captured image to a file.

using DevExpress.XtraEditors.Camera;

TakePictureDialog d = new TakePictureDialog();
if(d.ShowDialog() == System.Windows.Forms.DialogResult.OK){
    Image i = d.Image;
    i.Save("C:\\snapshot.bmp");
}

Select the Camera Device and Resolution

The Take Picture dialog saves the currently selected camera device and its resolution in the system registry when a user closes the dialog. These settings are reused the next time a user opens the dialog. If the system registry contains no information on the previously used camera device, the Take Picture dialog will use the default camera device (CameraControl.GetDefaultDevice).

To override the default camera device and resolution selection, use the TakePictureDialog.Device and TakePictureDialog.ResolutionMode properties.

The following example sets the maximum resolution for the selected camera device.

TakePictureDialog dialog = new TakePictureDialog();
dialog.ResolutionMode = ResolutionMode.Maximum;
dialog.ShowDialog();

Customize the Dialog and Output Image

The following events allow you to customize the dialog, camera device, resolution and captured image:

  • TakePictureDialog.Showing - Fires when the dialog is about to be displayed. Allows you to customize the form, and specify the camera device and resolution.
  • TakePictureDialog.Closed - Fires when the dialog is closed. Allows you to get the dialog result and captured image, and replace this image.

Inheritance

Object
TakePictureDialog
See Also