Skip to main content

RepositoryItemPictureEdit.TakePictureDialogShowing Event

Fires when the Take Picture dialog is about to be displayed. Allows you to customize the dialog, and specify the camera device and resolution.

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

[DXCategory("Events")]
public event TakePictureDialogShowingEventHandler TakePictureDialogShowing

Event Data

The TakePictureDialogShowing event's data class is TakePictureDialogShowingEventArgs. The following properties provide information specific to this event:

Property Description
Cancel Gets or sets a value indicating whether the event should be canceled. Inherited from CancelEventArgs.
Device Gets or sets the camera device.
Form Gets the form that encapsulates the dialog.
ManualResolution Gets or sets a camera resolution that is applied when the TakePictureDialogShowingEventArgs.ResolutionMode property is set to Manual.
ResolutionMode Gets or sets the camera resolution mode.

Remarks

The TakePictureDialogShowing event allows you to perform actions when the Take Picture dialog is about to be displayed.

image

The event’s Cancel parameter allows you to prevent the display of the dialog.

Access and Modify the Dialog

To modify the dialog (for instance, change the dialog’s title) use the event’s Form parameter.

private void pictureEdit1_TakePictureDialogShowing(object sender, DevExpress.XtraEditors.Camera.TakePictureDialogShowingEventArgs e) {
    e.Form.Text = "Camera";
}

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.

void pictureEdit1_TakePictureDialogShowing(object sender, TakePictureDialogShowingEventArgs e) {
    e.ResolutionMode = ResolutionMode.Maximum;
}

The PictureEdit.TakePictureDialogShowing and RepositoryItemPictureEdit.TakePictureDialogShowing events are equivalent.

See Also