【发布时间】:2012-06-02 11:43:02
【问题描述】:
我有一个相机应用程序,我在其中拍摄图像并将其存储在 SD 卡中。
当我检查存储图像的分辨率时,发现它是 120X160 像素。
但是,相机拍摄的正常图像是 640X480 像素。
我不希望分辨率降低。你能解释一下为什么会这样吗??
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-generated method stub
super.onActivityResult(requestCode, resultCode, data);
if(resultCode == RESULT_OK){
Bundle extras = data.getExtras();
Bitmap bmp1 = (Bitmap) extras.get("data");
//now storing the image in sdcard, folder name is same as the model name
ByteArrayOutputStream bytes1 = new ByteArrayOutputStream();
scaled1.compress(Bitmap.CompressFormat.PNG, 100, bytes1);
File f1 = new File(folder,"bmp1.png");
try {
f1.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
FileOutputStream fo1 = null;
try {
fo1 = new FileOutputStream(f1);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
fo1.write(bytes1.toByteArray());
fo1.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
我必须创建自己的相机活动吗?我是初学者..所以请帮助
【问题讨论】:
-
您的问题的解决方法可以在here
-
额外的“数据”并非旨在将捕获的图像传递给您的应用程序;它只是一个缩略图,可以用作图标或网格视图。全尺寸照片与相机应用程序拍摄的所有常规胶卷一起存储,除非您明确要求不同的位置(不是普遍支持的功能)。
标签: android android-camera android-image android-resolution