
보이는것처럼 사진이 카메라로 찍어서 이미지뷰에 넣으면 이미지화질이 깨지네요 ;;
갤러리에서 가져오면 깨끗한데 카메라로 찍기만하면 이렇게되네요 코드는 아래첨부할게요
public class Place_Gyoengbok_Gwanghwamun extends Activity{
Button mGallery, mCamera, mCertify;
ImageView imgView;
TextView mText;
Bitmap bmp;
Uri currImgURI;
String FilePath;
protected final int SELECT_GALLERY = 1;
protected final int SELECT_CAMERA = 2;
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.place_gyeongbok_gwanghwamun);
mGallery = (Button)findViewById(R.id.gallery);
mCamera = (Button)findViewById(R.id.camera);
imgView = (ImageView)findViewById(R.id.exgwanghwa);
mText = (TextView)findViewById(R.id.textgwanghwa);
mCertify = (Button)findViewById(R.id.certify);
mGallery.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent = new Intent();
intent.setAction(Intent.ACTION_GET_CONTENT);
intent.setType("image/*");
startActivityForResult(intent, SELECT_GALLERY);
}
});
mCamera.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent = new Intent();
intent.setAction(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent, SELECT_CAMERA);
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data){
if(resultCode == RESULT_OK){
if(requestCode==SELECT_CAMERA){
bmp =(Bitmap)data.getExtras().get("data");
mText.setText("CAMERA : " + data.getDataString());
imgView.setImageBitmap(bmp);
}else if(requestCode==SELECT_GALLERY){
try{
currImgURI=data.getData();
mText.setText("GALLERY : " + getRealPathFromURI(currImgURI));
imgView.setImageURI(currImgURI);
FilePath=getRealPathFromURI(currImgURI);
bmp=Images.Media.getBitmap(getContentResolver(), currImgURI);
}catch(Exception e){}
}
}
}
private String getRealPathFromURI(Uri uri) {
// TODO Auto-generated method stub
String[] projection = { MediaStore.Images.Media.DATA };
Cursor cursor = managedQuery(uri, projection, null, null, null);
int column_index = cursor
.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst();
return cursor.getString(column_index);
}
}