意图以方形模式打开默认相机
Intent to open default camera in square mode
我可以通过这个从意图中打开相机:
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);
}
}
有没有什么办法可以启动方形尺寸的相机?
我找到了解决方案,这对于原生 android sdk 是不可能的。谢谢
我可以通过这个从意图中打开相机:
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);
}
}
有没有什么办法可以启动方形尺寸的相机?
我找到了解决方案,这对于原生 android sdk 是不可能的。谢谢