ローカルに保存されているpng画像をBitmapとして取得
前回の記事の続きで、今回は、
ローカルに保存されているpng画像をBitmapとして取得する方法。
public static Bitmap readBitmapData(Context context, String fileName) {
Bitmap data = null;
if (fileName != null) {
try {
InputStream inputstream = context.openFileInput(fileName);
data = BitmapFactory.decodeStream(inputstream);
} catch (FileNotFoundException e) {
}
}
return data;
}