ES400:保存一张图像后 CameraCaptureDialog 错误
我在 ES400 中使用 CameraCaptureDialog 类时遇到错误,在捕获第二个图像时,它显示“无法找到图像”。但同样的代码在 MC35 中运行良好。
Dim app_path As String Dim ccd As New CameraCaptureDialog Dim count As Integer count = TransImagelst.Images.Count Try ccd.Owner = Me ccd.DefaultFileName = "Image" & count.ToString & ".jpg" ccd.Mode = CameraCaptureMode.Still ccd.StillQuality = CameraCaptureStillQuality.Low ccd.Resolution = New Size(0, 0) ccd.Title = "Image" ccd.InitialDirectory = DataBase_Path & "\" & Region & "\Image" ccd.ShowDialog() 'add files to image directory. If Not Directory.Exists(DataBase_Path & "\" & Region & "\Image") Then Directory.CreateDirectory(DataBase_Path & "\" & Region & "\Image") If ccd.FileName String.Empty Then TransImagelst.ImageSize = New Drawing.Size(55, 55) TransImagelst.Images.Add(New Bitmap(ccd.FileName)) TransImagelstv.View = View.LargeIcon TransImagelstv.LargeImageList = TransImagelst Dim lv As New ListViewItem("Image" & TransImagelst.Images.Count - 1) TransImagelstv.Items.Add(lv) lv.ImageIndex = TransImagelst.Images.Count - 1 End If
请帮帮我。
I am getting an error using the CameraCaptureDialog class in the ES400, while catpturing the second image it says "Could not find image". But the same code works fine in MC35.
Dim app_path As String Dim ccd As New CameraCaptureDialog Dim count As Integer count = TransImagelst.Images.Count Try ccd.Owner = Me ccd.DefaultFileName = "Image" & count.ToString & ".jpg" ccd.Mode = CameraCaptureMode.Still ccd.StillQuality = CameraCaptureStillQuality.Low ccd.Resolution = New Size(0, 0) ccd.Title = "Image" ccd.InitialDirectory = DataBase_Path & "\" & Region & "\Image" ccd.ShowDialog() 'add files to image directory. If Not Directory.Exists(DataBase_Path & "\" & Region & "\Image") Then Directory.CreateDirectory(DataBase_Path & "\" & Region & "\Image") If ccd.FileName String.Empty Then TransImagelst.ImageSize = New Drawing.Size(55, 55) TransImagelst.Images.Add(New Bitmap(ccd.FileName)) TransImagelstv.View = View.LargeIcon TransImagelstv.LargeImageList = TransImagelst Dim lv As New ListViewItem("Image" & TransImagelst.Images.Count - 1) TransImagelstv.Items.Add(lv) lv.ImageIndex = TransImagelst.Images.Count - 1 End If
Please help me out.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也有同样的问题。尽管 ES400 功能丰富,但它无法与 Cameracapturedialog 配合使用。它甚至不支持 Motorla EMDK SDK 中的成像库。这真是令人费解。
EMDK 程序员指南中有一个 ES400 编程条目,其中指出 - 您必须使用 Microsoft 的 DirectShow 来捕获图像。我尝试了这种方法,但我只能获得 VGA 分辨率,这对于我的目的来说是垃圾。如果这对您来说足够了,您可以查看 http://alexmogurenko.com/blog/directshownetcf/< /a>.在这一点上我对ES400非常失望。
我最终使用了一个有点垃圾的简单解决方案,但至少它有效(参见下面的概述,祝你好运)。
I had the same problem. Although ES400 is stuffed with features, it does not work with the Cameracapturedialog. It does not even support the Imaging library in the Motorla EMDK SDK. This is baffeling.
The EMDK Programmers Guide has an ES400 Programming entry which states - You must use Microsoft’s DirectShow for capturing images. I tried this approach, but I could only get VGA resolution which is rubbish for my purpose. If this is sufficient for you, you might have a look at http://alexmogurenko.com/blog/directshownetcf/. I am extremely disappointed of the ES400 on this point.
I ended up using a simple soliution that is a bit rubbish, but at least it works (see outline below and good luck).