windowsforms-devexpress-dot-xtraeditors-dot-repository-dot-repositoryitempictureedit-0a6575d6.md
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.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[DXCategory("Events")]
public event TakePictureDialogShowingEventHandler TakePictureDialogShowing
<DXCategory("Events")>
Public Event TakePictureDialogShowing As TakePictureDialogShowingEventHandler
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. |
The TakePictureDialogShowing event allows you to perform actions when the Take Picture dialog is about to be displayed.
The event’s Cancel parameter allows you to prevent the display of 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";
}
Private Sub PictureEdit1_TakePictureDialogShowing(sender As Object, e As DevExpress.XtraEditors.Camera.TakePictureDialogShowingEventArgs) _
Handles PictureEdit1.TakePictureDialogShowing
e.Form.Text = "Camera"
End Sub
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;
}
Sub PictureEdit1_TakePictureDialogShowing(sender As Object, e As DevExpress.XtraEditors.Camera.TakePictureDialogShowingEventArgs) Handles PictureEdit1.TakePictureDialogShowing
e.ResolutionMode = DevExpress.XtraEditors.Camera.ResolutionMode.Maximum
End Sub
The PictureEdit.TakePictureDialogShowing and RepositoryItemPictureEdit.TakePictureDialogShowing events are equivalent.
See Also
RepositoryItemPictureEdit Class