打算在方形模式下打开默认相机

时间:2019-05-13 08:54:46

标签: android android-intent android-camera

我可以这样打开摄像机:

Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);

                // Ensure that there's a camera activity to handle the intent
                if (takePictureIntent.resolveActivity(getPackageManager()) != null) {
                    // Create the File where the photo should go
                    File photoFile = null;
                    try {
                        photoFile = Utility.createImageFile(BotActivity.this);
                    } catch (IOException ex) {
                        // Error occurred while creating the File

                    }
                    // Continue only if the File was successfully created
                    if (photoFile != null) {
                        Uri photoURI = FileProvider.getUriForFile(BotActivity.this,
                                "com.kutumbita.app.fileprovider",
                                photoFile);

                        takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);
                        startActivityForResult(takePictureIntent, CAMERA_CAPTURE_REQUEST);
                    }
                }

有没有办法以正方形尺寸启动该相机?

1 个答案:

答案 0 :(得分:0)

我得出的解决方案是,使用本地android sdk无法实现。谢谢