0
我想拍摄指定尺寸的图像并将其保存在SD卡上的所需位置。我正在使用intent.putExtra通过默认的相机应用程序拍摄图像。修改Android中摄像头拍摄的图像的尺寸
这里去的代码
public void onClick(View v) {
//Setting up the URI for the desired location
imageFile = "bmp"+v.getId()+".png";
File f = new File (folder,imageFile);
imageUri = Uri.fromFile(f);
//Setting the desired size parameters
private Camera mCamera;
Camera.Parameters parameters = mCamera.getParameters();
parameters.setPreviewSize(width, height);
mCamera.setParameters(parameters);
//Passing intent.PutExtras to defaul camera activity
Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
i.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, imageUri);
startActivityForResult(i,CAMERA_PIC_REQUEST);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if(resultCode == RESULT_OK){
return;
}
拍摄的图像后,相机activiy力关闭。 是否可以通过这种方式修改默认相机活动拍摄的图像的大小?
或者单独的相机应用程序是必要的?
我们想不通为什么有问题如果你不告诉我们什么问题*是*。 – Eric
我编辑了这个问题,请看一下 –
你可以用强制关闭的完整日志来编辑你的问题吗?而且,如果你能够阅读它们,那么突出显示那部分代码也是有用的。 – Eric