我试图创建一个简单的应用程序,其活动包含2个按钮(制作照片并分享):
确定。这就是最后的结果。 :) 现在我只是想获得真实的图像,而不是缩小缩略图。 我找到了这段代码,但它返回缩小的图像:
public class CameraDemo extends Activity {
Button ButtonClick;
int CAMERA_PIC_REQUEST = 2;
int TAKE_PICTURE=0;
Camera camera;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ButtonClick =(Button) findViewById(R.id.Camera);
ButtonClick.setOnClickListener(new OnClickListener (){
@Override
public void onClick(View view)
{
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
super.onActivityResult(requestCode, resultCode, data);
if( requestCode == CAMERA_PIC_REQUEST)
{
Bitmap thumbnail = (Bitmap) data.getExtras().get("data");
ImageView image =(ImageView) findViewById(R.id.PhotoCaptured);
image.setImageBitmap(thumbnail);
}
else
{
Toast.makeText(demo.this, "Picture NOt taken", Toast.LENGTH_LONG);
}
}
}
如何返回完整尺寸的图像或至少返回全尺寸图像的路径? 因为我想分享完整尺寸的照片,而不是缩小缩略图。