I need to enlarge image I am using the following code for it
int imageId = (Integer) intent.getExtras().get(ProfilePageNormalUser.class.getName());
imageView = (ImageView)findViewById(R.id.imageviewEnlarged);
System.out.println("*********"+imageId);
InputStream is = this.getResources().openRawResource(imageId);
Bitmap originalBitmap = BitmapFactory.decodeStream(is);
Matrix imageMatrix = new Matrix(); imageMatrix.postRotate(90);
Bitmap scaledBitmap = Bitmap.createBitmap(originalBitmap, imageView.getWidth(), imageView.getHeight(), originalBitmap.getWidth(), originalBitmap.getHeight(), imageMatrix, false);
imageView.setImageBitmap(scaledBitmap);
But is giving me the above exception .
Resources$NotFoundException: Resource ID #0x4
Can anyone tell me where could be the problem.
Thanks
i think to use
this.getResources().openRawResource(id). You’ll have to move your resource to res/raw folder.Try creating a folder named raw under res folder and paste your resource there.
Let me know how it goes..