Android多媒体(照相机和录像机)

发布时间:2020-08-04 10:32:50 作者:秋寒526
来源:网络 阅读:344

一丶照相机的应用

创建意图对象启动拍照

        Intent intent = new Intent();

//设置动作

        intent. setAction(MediaStore.Action_p_w_picpath_capture);

//设置图片保存的路径
        File file = new File(Environment.getExternalStorageDirectory() + "/haha.png");
        //设置照片的名字
        intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
        //启动意图拍照
        startActivityForResult(intent,0);

二丶录像机的应用

    //创建一个意图对象
        Intent intent = new Intent();
        //设置他的动作
        intent.setAction(MediaStore.ACTION_VIDEO_CAPTURE);
        
        //创建文件保存路径
        File file = new File(Environment.getExternalStorageDirectory() + "/haha.mp4");
        //指定文件名字
        intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
        //设置视频的录制质量是高质量,大尺寸
        intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
        //启动系统的录象程序录像

推荐阅读:
  1. 自定义录像机 没任何新意
  2. android多媒体

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

图片 多媒体 android

上一篇:windows上如何彻底删除jupyter notebook

下一篇:Hadoop用户重新部署HDFS

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》