I’m trying to get an image from sd card using the intent
Intent choosePictureIntent = new Intent(Intent.ACTION_PICK,
android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(choosePictureIntent, 0);
by using this
BitmapFactory.Options bmpFactoryOptions = new BitmapFactory.Options();
bmp = BitmapFactory.decodeStream(getContentResolver().openInputStream(
imageFileUri), null, bmpFactoryOptions);
chosenImageView.setImageBitmap(bmp);
chosenImageView referring to ImageView but whenever i try using SurfaceView, it doesn’t given me the .setImageBitmap.
I know how to get an image over imageView but over Surface I find it kind of difficult to get the concept.
With
SurfaceViewyou should create a staticArrayListorVectorto store yourBitmapand draw Bitmap inonDrawNow we need to handle the thread in our panel class.
Create panel in xml and get it in your activity. In order to draw image from
SDcardusing Intent to open Gallery, I use this to put retrieved image in onActivityForResult.You free to add any bitmap using
Panel.getElements.add(bitmap);Another tutorial you can see is 2D Tutorial Series which show very basic steps.