问题描述
问题:
当我用我的应用程序来拍摄照片并将其存储在SD,分辨率为160×120。如果使用普通的摄像头,照片分辨率为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?
这是在code我用启动摄像头的意图和保存照片:
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
这篇关于应用程序 - >相机 - >照片 - >低分辨率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!