void camera_PictureTaken(object sender, Canon.Eos.Framework.Eventing.EosImageEventArgs e) { var camera = sender as EosCamera; if (camera == null) return; if (FListeningTo.ContainsValue(camera)) { foreach (var key in FListeningTo.Keys) { if (FListeningTo[key] == camera) { FPictureTaken.Add(key); FOutImage[key].Send(e.GetBitmap()); } } } }
/* * NOTE: * * getBitmap() is not available in EosLiveImageEventArgs. ssems we need aproper c# wrapper that exposes something like: * * err = EDSDK.EdsCreateEvfImageRef(stream, out EvfImageRef); * if (err == EDSDK.EDS_ERR_OK) err = EDSDK.EdsDownloadEvfImage(MainCamera.Ref, EvfImageRef); * if (err == EDSDK.EDS_ERR_OBJECT_NOTREADY) continue; * else Error = err; * */ //void FCamera_LiveViewUpdate(object sender, Canon.Eos.Framework.Eventing.EosImageEventArgs e) void FCamera_LiveViewUpdate(object sender, Canon.Eos.Framework.Eventing.EosLiveImageEventArgs e) { var camera = sender as EosCamera; if (camera == null) return; if (FListeningTo.ContainsValue(camera)) { foreach (var key in FListeningTo.Keys) { if (FListeningTo[key] == camera) { FPictureTaken.Add(key); var bitmap = e.GetBitmap(); // not available >> exception in Canon.Eos.framework.dll FOutImage[key].Send(bitmap); bitmap.Dispose(); } } } }