将从相机拍摄的大图像设置为ImageView

时间:2015-08-10 19:14:56

标签: android

我在拍摄照片时遇到问题,并在我的活动中将其设置为ImageView,但它无效。有一个logcat错误。

@Override
public void onClick(View v) {
    // TODO Auto-generated method stub
    switch(v.getId()) {
    case R.id.imageButton1:
        Intent c = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
        startActivityForResult(c, CAMERA_PIC_REQUEST);
    }
}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    // TODO Auto-generated method stub
    super.onActivityResult(requestCode, resultCode, data);

    if ( resultCode == CAMERA_PIC_REQUEST ) {
        Bundle extras = data.getExtras();
        bmp = (Bitmap) extras.get("data");
        iv.setImageBitmap(bmp);
    }       

这是logcat:

08-11 00:16:56.966: E/OpenGLRenderer(18975): SFEffectCache:clear(), mSize = 0
08-10 23:41:24.131: E/(27584): [android_ws] Format: 5, Width: 1080, Height: 1920
08-10 23:41:24.141: E/(27584): [android_ws] Format: 5, Width: 1080, Height: 1920
08-10 23:41:24.141: E/(27584): [android_ws] Format: 5, Width: 1080, Height: 1920
08-10 23:41:24.141: E/(27584): [android_ws] Format: 5, Width: 1080, Height: 1920

0 个答案:

没有答案