我有来自gallary的图像数量。
我想将所选图片存储到mnt/sdcard/somefolder/image
IMAGE_PATH = getIntent().getStringExtra(bean.getImagePath());
imgDisplayImage = (ImageView) findViewById(R.id.imgDisplay);
Bitmap bitmap = BitmapFactory.decodeFile(IMAGE_PATH);
System.out.println("IMAGE PATH IN IMAGEDISPLAY CLASS"+ IMAGE_PATH);
imgDisplayImage.setImageBitmap(bitmap);
答案 0 :(得分:1)
其实我无法理解.. 从相机拍摄照片直接在画廊中设置。
但是如果表面视图中有问题,请使用此代码......
View viewControl = controlInflater.inflate(R.layout.camara_view, null);
LayoutParams layoutParamsControl = new LayoutParams(
LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
this.addContentView(viewControl, layoutParamsControl);
btnGallary = (Button) findViewById(R.id.btnGallery);
btnCaptureImage = (Button) findViewById(R.id.btnCaptureImage);
// Button buttonTakePicture = (Button)findViewById(R.id.takepicture);
btnCaptureImage.setOnClickListener(new Button.OnClickListener() {
@Override
public void onClick(View arg0) {
camera.takePicture(myShutterCallback, myPictureCallback_RAW,
myPictureCallback_JPG);
}
});
btnGallary.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Intent intent = new Intent(getApplicationContext(),
// ImageGallery.class);
// startActivity(intent);
Intent intent = new Intent(
Intent.ACTION_PICK,
android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI);
startActivityForResult(intent, REQUEST_CODE);
}
});