まめーじぇんと@Tech

技術ネタに関して (Android, GAE, Angular). Twitter: @mame01122

ローカルに保存されている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;
}

これで大丈夫なハズ。
前回のBitmapをpng画像として保存するメソッドとともにどうぞ。