Delphi - How to get Directory with OpenDialog using iPhone as a picture source

我是研究僧i 提交于 2019-12-20 07:19:11

问题


I have a Delphi app (D2010) which lets the user select a JPG file via an OpenDialog. When I select the file from a normal Windows directory, my TOpenDialog.Filename contains the FULL PATH to the file, and my code works. The issue I am running into is that the user will often be copying the file phone a cell phone. When the user plugs in the phone, runs my code, the TOpenDialog Shows the files on the cell phone, the user picks the proper jpg file, but the TOenDialog.Filename does NOT contain the path to the file (only the name of the file), so my program cannot find the file.

For both CAMERAS and CELL PHONES, the picture directory is the DCIM directory. For whatever reason, Windows 7 and probably all others, does NOT provide a drive letter to this directory. As such TOpenDialog only returns the file name, not the full path name. This means I cannot copy the file since I don't have a full path name.

So in short, my question is: How do I use TOpenDialog to get the full path name, when the path is a storage area on a cell phone (in my case, iPhone 5). XE5 has a routine called GetCameraPath, but D2010 does not.

来源:https://stackoverflow.com/questions/20442747/delphi-how-to-get-directory-with-opendialog-using-iphone-as-a-picture-source

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!