如何获取最后一张拍摄的照片
有人可以告诉我如何使用 WIA 从我的相机中获取最后拍摄的照片的预览图像吗?
这就是拍照所需的全部内容:
//select device
WIA.CommonDialog dialog = new WIA.CommonDialog();
WIA.Device camera = dialog.ShowSelectDevice(WIA.WiaDeviceType.CameraDeviceType, false, true);
//take picture
camera.ExecuteCommand("{AF933CAC-ACAD-11D2-A093-00C04F72DC3C}");
有了这个我可以获得所有相机属性,但没有最后一张照片信息:
string p = "";
foreach (Property p in camera.Properties)
{
p += p.Name + ":\t" + p.get_Value() + "\n";
}
MessageBox.Show(p);
can some tell me how to get a preview image of the last taken picture from my camera with WIA?
This is all you need to take a picture:
//select device
WIA.CommonDialog dialog = new WIA.CommonDialog();
WIA.Device camera = dialog.ShowSelectDevice(WIA.WiaDeviceType.CameraDeviceType, false, true);
//take picture
camera.ExecuteCommand("{AF933CAC-ACAD-11D2-A093-00C04F72DC3C}");
with this I can get all camera properties, but there is no last picture info:
string p = "";
foreach (Property p in camera.Properties)
{
p += p.Name + ":\t" + p.get_Value() + "\n";
}
MessageBox.Show(p);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ExecuteCommand 返回一个 WIA.Item,它提供 Transfer 方法:
ExecuteCommand returns a WIA.Item which provide a Transfer method :