从佳能相机下载图片到电脑的问题
我将 eos 佳能相机连接到电脑
我有一个应用程序,我可以远程拍照,并将图像下载到电脑,
但是当我从相机中取出SD卡时,我无法将图像从缓冲区下载到电脑
//注册objceteventcallback
err = EDSDK.EdsSetObjectEventHandler(obj.camdevice, EDSDK.ObjectEvent_All, objectEventHandler, new IntPtr(0));
if (err != EDSDK.EDS_ERR_OK)
Debug.WriteLine("Error registering object event handler");
///
public uint objectEventHandler(uint inEvent, IntPtr inRef, IntPtr inContext)
{
switch(inEvent)
{
case EDSDK.ObjectEvent_DirItemCreated:
this.getCapturedItem(inRef);
Debug.WriteLine("dir item created");
break;
case EDSDK.ObjectEvent_DirItemRequestTransfer:
this.getCapturedItem(inRef);
Debug.WriteLine("file transfer request event");
break;
default:
Debug.WriteLine(String.Format("ObjectEventHandler: event {0}", inEvent));
break;
}
return 0;
}
任何人都可以帮助我,为什么这个事件不调用,
或者我如何将图像从缓冲区下载到电脑,而相机上没有 SD 卡,
谢谢
i connected a eos canon camera to pc
i have an application that i could take picture remotly ,and download image to pc,
but when i remove the SD card from camera , i cant download image from buffer to pc
// register objceteventcallback
err = EDSDK.EdsSetObjectEventHandler(obj.camdevice, EDSDK.ObjectEvent_All, objectEventHandler, new IntPtr(0));
if (err != EDSDK.EDS_ERR_OK)
Debug.WriteLine("Error registering object event handler");
///
public uint objectEventHandler(uint inEvent, IntPtr inRef, IntPtr inContext)
{
switch(inEvent)
{
case EDSDK.ObjectEvent_DirItemCreated:
this.getCapturedItem(inRef);
Debug.WriteLine("dir item created");
break;
case EDSDK.ObjectEvent_DirItemRequestTransfer:
this.getCapturedItem(inRef);
Debug.WriteLine("file transfer request event");
break;
default:
Debug.WriteLine(String.Format("ObjectEventHandler: event {0}", inEvent));
break;
}
return 0;
}
anyone could help me , why this event does not call ,
or how i download image from buffer to pc, with out have Sd card on my camera
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可能遇到了与我昨天相同的问题:相机尝试存储图像以供以后下载,但发现没有存储卡可以存储它并立即丢弃图像。
要触发回调,您需要将相机设置为在相机初始化例程期间的某个时刻将图像保存到 PC (kEdsSaveTo_Host)。在 C++ 中,它的工作方式如下:
您可能需要为此构建一个 IntPtr。至少,这就是 Dmitriy Prozorovskiy 在 akadunno提示) “nofollow”>此帖子。
You probably ran into the same problem as I did yesterday: the camera tries to store the image for a later download, finds no memory card to store it to and instantly discards the image.
To get your callback to fire, you need to set the camera to save images to the PC (kEdsSaveTo_Host) at some point during your camera initialization routine. In C++, it worked like this:
You probably need to build an IntPtr for this. At least, that's what Dmitriy Prozorovskiy did (prompted by a certain akadunno) in this thread.
SDK(据我所知)仅以在相机文件系统(即SD卡)上创建的对象的形式公开拍照事件。没有我熟悉的从缓冲区捕获的方法。在某种程度上这是有道理的,因为在只有少量板载内存的环境中,保持易失性内存清晰非常重要,这样才能继续拍照。一旦缓冲区被刷新到非易失性内存,您就可以与这些字节进行交互。我知道这是有限制的,但事实就是如此。
The SDK (as far as I know) only exposes the picture taking event in the form of the object being created on the file system of the camera (ie the SD card). There is not a way of which I am familiar to capture from buffer. In a way this makes sense, because in an environment where there is only a small amount of onboard memory, it is important to keep the volatile memory clear so that it can continue to take photographs. Once the buffer has been flushed to nonvolatile memory, you are then clear to interact with those bytes. Limiting, I know, but it is what it is.
问题要求 C#,但在 Java 中,必须将属性设置为:
通常的下载就可以了
The question asks for C#, but in Java one will have to setProperty as:
And the usual download will do