Create Bitmap From File

[Solved] Create Bitmap From File | Kotlin - Code Explorer | yomemimo.com
Question : create bitmap from file

Answered by : manuel-armando-iturbides

File sd = Environment.getExternalStorageDirectory();
File image = new File(sd+filePath, imageName);
BitmapFactory.Options bmOptions = new BitmapFactory.Options();
Bitmap bitmap = BitmapFactory.decodeFile(image.getAbsolutePath(),bmOptions);
bitmap = Bitmap.createScaledBitmap(bitmap,parent.getWidth(),parent.getHeight(),true);
imageView.setImageBitmap(bitmap);

Source : https://stackoverflow.com/questions/16804404/create-a-bitmap-drawable-from-file-path | Last Update : Wed, 20 Jul 22

Answers related to create bitmap from file

Code Explorer Popular Question For Kotlin