Events
You can receive camera events of the connected camera using the CameraEventListener
class.
Contents
- Supported Camera Events
- How to Register Events
- Capture Settings Supported by CaptureSettingsChanged
- See Also
Supported Camera Events
RICOH Camera USB SDK supports the following camera events:
ImageAdded
is called when image is added. You can transfer image data before ImageStored is called.ImageStored
is called when image has been stored to the camera storage.CaptureComplete
is called when capturing an image is completed.DeviceDisconnected
is called when the camera you’ve already made a connection is disconnected.LiveViewFrameUpdated
is called when live view frame data is updated.CaptureSettingsChanged
is called when supported capture settings are changed. It does not be called if you change directly withSetCaptureSettings
method.
Register Events
Override the virtual method corresponding to the event you want to receive in your derived class of CameraEventListener
. You can also see Live View for an example of LiveViewFrameUpdated
.
class UserEventListener : CameraEventListener
{
public override void ImageAdded(CameraDevice sender, CameraImage image)
{
Console.WriteLine(
"Image Added. Name: {0}, Type: {1}, Format: {2}, Size: {3}, " +
"ID: {4}", image.Name, image.Type, image.Format, image.Size,
image.ID);
}
public override void ImageStored(CameraDevice sender, CameraImage image)
{
Console.WriteLine(
"Image Stored. Name: {0}, Type: {1}, Format: {2}, Size: {3}, " +
"ID: {4}", image.Name, image.Type, image.Format, image.Size,
image.ID);
}
public override void CaptureComplete(CameraDevice sender, Capture capture)
{
Console.WriteLine("Capture Complete. Capture ID: {0}", capture.ID);
}
public override void DeviceDisconnected(
CameraDevice sender,
DeviceInterface deviceInterface)
{
Console.WriteLine("Device Disconnected.");
}
public override void CaptureSettingsChanged(CameraDevice sender,
List<CaptureSetting> newSettings)
{
Console.WriteLine("CaptureSettingsChanged:");
foreach (var setting in newSettings)
{
if (setting is ShutterSpeed) {
Console.WriteLine(" {0}", setting.ToString()); }
else if (setting is WhiteBalance) {
Console.WriteLine(" {0}", setting.ToString()); }
else if (setting is FNumber) {
Console.WriteLine(" {0}", setting.ToString()); }
else if (setting is ISO) {
Console.WriteLine(" {0}", setting.ToString()); }
else if (setting is ExposureCompensation) {
Console.WriteLine(" {0}", setting.ToString()); }
else if (setting is ExposureProgram) {
Console.WriteLine(" {0}", setting.ToString()); }
else if (setting is HyperOperationEnable) {
Console.WriteLine(" {0}", setting.ToString()); }
else if (setting is UserCaptureSettingsMode) {
Console.WriteLine(" {0}", setting.ToString()); }
}
}
}
And register the event listener as follows:
CameraEventListener userEventListener = new UserEventListener();
cameraDevice.EventListeners.Add(userEventListener);
Registered events are called when corresponding events occur at CameraDevice
.
Capture Settings Supported by CaptureSettingsChanged
The Capture Settings to be notified are as follows.
- Aperture Value
- Exposure Compensation
- ISO Sensitivity Value
- White Balance
- Shutter Speed
- Exposure Program
- Hyper Operation Settings
- User Capture Settings Mode
See Also
- Still Image Capture - Demonstrates how to capture still images.
- Connection - Demonstrates how to make connections with cameras.
- Live View - Describes
LiveViewFrameUpdated
. - Capture Settings - Describes available capture settings.