在我正在开发的应用程序中,一个按钮会打开相机。当您拍照时,该图片会作为位图加载到应用程序中。图片非常像素化。将位图加载到我的应用程序后,如何提高位图的质量?
到目前为止的代码:
private static final int CAMERA_PIC_REQUEST = 2500;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button capture = (Button) findViewById(R.id.captureButton);
Button flip = (Button) findViewById(R.id.flipButton);
final TextView text = (TextView) findViewById(R.id.text);
capture.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
text.setVisibility(View.GONE);
startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);
}
});
flip.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
}
});
}
protected void onActivityResult(int requestCode, int resultCode, Intent data){
if(requestCode == CAMERA_PIC_REQUEST){
Bitmap image = (Bitmap) data.getExtras().get("data");
ImageView imageView = (ImageView) findViewById(R.id.ImageView01);
imageView.setImageBitmap(image);
}
}
}