Android之通过ContentResolver获取手机图片和视频的路径和生成缩略图和缩略图路径
发布日期:2021-06-29 14:13:01 浏览次数:2 分类:技术文章

本文共 740 字,大约阅读时间需要 2 分钟。

1 问题

获取手机所有图片和视频的路径和生成图片和视频的缩略图和缩略图路径

生成缩略图我们用的系统函数

public static Bitmap getThumbnail(ContentResolver cr, long origId, int kind, Options options) {                throw new RuntimeException("Stub!");            }

调用如下

MediaStore.Images.Thumbnails.getThumbnail

 

 

 

 

 

2 获取手机所有视频测试代码

/**     *get system orignal Thumbnail     **/    private String getVideoSystemThumbnail(Content content, String id) {        String thumbnail = "";        ContentResolver cr = content.getContentResolver();        Cursor cursor = cr.query(                MediaStore.Video.Thumbnails.EXTERNAL_CONTENT_URI,                new String[]{                        MediaStore.Video.Thumbnails.DATA                },                MediaStore.Video.Thumbnails.VIDEO_ID + "=&#

转载地址:https://chenyu.blog.csdn.net/article/details/83628654 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:React Native之函数作为参数传递给另外一个函数去调用
下一篇:React Native之react-native bundle --platform android --dev false --entry-file index.js --bundle失败

发表评论

最新留言

做的很好,不错不错
[***.243.131.199]2024年04月16日 22时48分10秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章