应用程序->相机 ->照片 ->低解析度 [英] App -> Camera -> Photo -> low resolution
问题描述
问题:
当我使用我的应用拍摄照片并将其存储在 SD 上时,分辨率为 160x120.如果使用普通相机,照片分辨率为1920x2560.
When I use my app to take a photo and store it on SD, the resolution is 160x120. If using camera ordinary, resolution of photos is 1920x2560.
那么,请帮我说说我必须做什么才能强制相机从应用程序开始以标准高分辨率拍照?
So, please help me saying what I have to do to force camera, started from the app, to take a photo in the standard high resolution?
这是我用于启动相机意图和保存照片的代码:
This is the code I use for starting camera intent and saving the photo:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraIntent, CAMERA_REQUEST);
}
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == CAMERA_REQUEST) {
Bundle xz = data.getExtras();
if (xz!=null) {
Bitmap image = (Bitmap) data.getExtras().get("data");
String filePath = "/mnt/sdcard/DCIM/";
filePath += "hml.png";
try {
image.compress(Bitmap.CompressFormat.PNG, 100, new FileOutputStream(new File(filePath)));
}
catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();}
catch (NullPointerException e) {
// TODO Auto-generated catch block
e.printStackTrace(); }
}}
谢谢!
推荐答案
如果您没有为输出图像提供 uri,则相机意图将仅返回图片的缩略图.请按照以下说明正确执行此操作:http://www.tutorialforandroid.com/2010/10/take-picture-in-android-with.html
If you don't supply a uri for the output image, the camera intent will return only a thumbnail of the picture. Follow these instructions on how to do this properly: http://www.tutorialforandroid.com/2010/10/take-picture-in-android-with.html
这篇关于应用程序->相机 ->照片 ->低解析度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!