【问题标题】:How to get all files from Gallery without using s3eImagePicker in Marmalade?如何在不使用果酱中的 s3eImagePicker 的情况下从图库中获取所有文件?
【发布时间】:2012-04-13 04:41:06
【问题描述】:

我需要从图库中获取所有文件,并在网格布局中显示实际图像文件的缩略图以供选择。在这种情况下,我无法使用 s3eImagePicker,因为它会打开我无法在其中添加按钮的 Gallery 应用程序。基本上我的应用程序要求是以缩略图形式向用户显示图库中的所有图像。当用户选择任何缩略图并按下上传按钮时,我需要将实际图像从图库复制到用户选择的应用程序文件夹。所以我的 UI 包含缩略图的网格布局、目标文件夹列表和两个按钮,即取消和上传。 s3eImagePicket 无法实现这种 UI。所以我正在寻找其他可以提供图库中所有文件的路径信息的解决方案。

请注意,我正在为 iPad 和 Android 开发应用程序。

橘子酱团队成员:您能回答一下吗?对于联系人,我可以在不使用默认联系人应用程序的情况下从设备读取,但对于图库则不可能。如果可能并且没有解决方案,您能否将此作为新功能提出来?

【问题讨论】:

    标签: ios marmalade


    【解决方案1】:

    在 marmalade 中,如果您正在搜索一个目录(例如画廊目录)中所有文件的路径,以下是一种方法:

    std::string strDirectory = "[GALLERY PATH HERE]";
    s3eFileList *pFileList = s3eFileListDirectory( strDirectory.c_str() );
    if( pFileList == NULL )
    {
        return;
    }
    char pFileName[255];
    int32 iFileNameLen( 255 );
    while( s3eFileListNext( pFileList,
                            pFileName,
                            iFileNameLen ) == S3E_RESULT_SUCCESS )
    {
        s3eDeviceYield(); // use this yield if there are potentially many files
    
        std::string strImagePath = strDirectory + pFileName;
    
        ...
        do whatever you want now with your paths for files in gallery
        ...
    }
    
    
    s3eFileListClose( pFileList );
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-02-24
      • 2013-08-28
      • 2011-08-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-04-30
      相关资源
      最近更新 更多