浏览文件夹看不到相机设备 [英] Browse for folder can't see camera device

查看:78
本文介绍了浏览文件夹看不到相机设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Delphi 2010中,我希望允许用户浏览并选择一个文件夹。该文件夹位于DSLR创建的设备(?)上。

In Delphi 2010, I want to allow users to browse and select a folder. The folder is on a device (?) created by a DSLR.

该文件夹在Windows资源管理器中可见,如上所示。并且,该文件夹在TOpenDialog中可见,允许他们浏览该文件夹并选择一个文件

The folder is visible in the Windows Explorer as shown above. And, the folder is visible in a TOpenDialog, allowing them to browse into the folder and choose a file.

不幸的是,我无法获取SHBrowseForFolder(我在网上找到的代码,但不理解)或SelectDirectory来查看其下方的摄像头设备或文件夹。 (附带说明:IMO,SelectDirectory是一个更好的用户界面,因为用户可以在浏览时看到文件夹中的文件。)

Unfortunately, I have been unable to get either SHBrowseForFolder (code I found on the web but don't understand) or SelectDirectory to see the camera device or folder beneath it. (Side note: IMO, SelectDirectory is a far nicer UI, since the user can see the files in the folders while browsing.)

我认为这与事实上,该文件夹位于由相机软件创建的设备(?)中。

I assume this has to do with the fact that the folder is in a device (?) created by the camera software.

我已经看到一些技巧,可以调用TOpenDialog来浏览带有'*的文件夹。 ',然后在结果上显示ExtractFileDir,但这并不可靠,或者IMO也不是一个好的UI。

I've seen some tricks where you call TOpenDialog to browse for folders with '*.' and then ExtractFileDir on the result, but that's not robust or, IMO, a good UI.

我正在寻找的是浏览文件夹,它可以看到与TOpenDialog&相同的设备(包括摄像头设备)。 Windows资源管理器可以看到。 (理想情况下,它看起来像下面的样子!)

What I'm looking for is a "Browse for folder" that can see the same devices (including the camera device) the TOpenDialog & Windows Explorer can see. (Ideally, it would have the nice appearance like the one below!)

有任何建议吗?

后来: 从连接到计算机和

Later: Capture Images from Camera connected to Computer and listed in Imaging Devices has what I was looking for.

推荐答案

您在其中看到的文件夹已绘制由Windows资源管理器的扩展名决定,它不是驱动器。它在那里,因此您可以使用Windows资源管理器轻松地在设备中复制内容。 Windows Explorer扩展程序可能会处理所有操作。这样考虑:该设备上的文件将具有哪个PATH?如果没有指向该文件的PATH,就无法从任何Windows应用程序中真正打开它!

The folder you're seeing in there is drawn up by a extension to Windows Explorer, it's not an "drive". It's there so you can easily copy stuff in and out of the device Using Windows Explorer. All operations are probably handled by the Windows Explorer Extension. Think of it this way: What PATH would the file on that device have? Without a PATH to the file you can't really open it from any Windows application!

进入DSLR相机菜单,找到告诉其设置的内容。通过USB连接到PC并将其更改为存储设备(看起来并不专有的任何东西,您可能有2或3个选项)时执行此操作。默认情况下,您的DSLR设置为允许其与PC上运行的相机自动化软件对话的模式!将设置更改为存储设备后,Windows会像对待其他任何USB存储设备一样对待它,为其分配驱动器号,然后您就可以从Delphi应用程序中访问它。或者执行大多数DSLR所有者的操作,将卡从DSLR中取出,放入读卡器中。

Go into the menu of your DSLR camera, find the setting that tells it what to do when connected via USB to the PC and change that to "Storage Device" (anything that doesn't look proprietary, you probably have 2 or 3 options). By default your DSLR is set to an mode that allows it to talk to camera-automation software running on the PC! Once you change that setting to "storage device" Windows will treat it like any other USB storage device, will assign it a drive letter and you'll be able to access it from your Delphi application. Or do what most DSLR owners do, take out the card out of your DSLR and put it into your card reader.

编辑:从图片中的名字,您有佳能350D相机。转到最右边的设置菜单,找到通讯选项,将其设置为 PC连接。默认值为:打印/ PTP。如果您确实想通过Print / PTP协议使用相机,则很可能可以,但是您需要查找特定的API,因为在这种模式下,相机的存储不会映射到文件系统中,因此您可以t将其作为文件和文件夹打开。

Edit: From the name in the picture, you've got a Canon 350D camera. Go to the rightmost settings menu, find the Communication option, set it to "PC Connection". The default is: "Print/PTP". If you really want to work with a camera over the Print/PTP protocol, you most likely can, but you need to look for specific API's, because in that mode your camera's storage doesn't map into your file system, so you can't open stuff as files and folders.

这篇关于浏览文件夹看不到相机设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆