In my Android project I have imageButton , and after clicking on it , it must open new Activity with imageView , and in my new Activity I must see the ImageButton\'s image only
below code can help you for resize an Image
File dir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM);
File output = new File(dir, "image.png");
path = output.getAbsolutePath();
Bitmap b = BitmapFactory.decodeFile(cPath);
Bitmap out = Bitmap.createScaledBitmap(b, 320, 480, false);
FileOutputStream fout;
try{
fout = new FileOutputStream(output);
out.compress(Bitmap.CompressFormat.PNG, 100, fout);
fout.flush();
fout.close();
b.recycle();
out.recycle();
}catch(Exception e){
e.printStackTrace();
}