http://blog.csdn.net/flowingflying/article/details/6212512
http://blog.csdn.net/flowingflying/article/details/6846991
嘿唷學習日記
2011年10月10日 星期一
2011年10月8日 星期六
Android - 資料庫存圖片路徑參考資料
Android 有四個地方能夠讀取圖片,包含
- SD card
- res 文件夾
- src 文件夾
- Assets 目錄
其中在 SD卡只要取其 SD卡的絕對路徑即可
而 res 文件夾則需要再主程式補寫 Code
ApplicationInfo appInfo = getApplicationInfo();
int resID = getResources().getIdentifier(Integer.toString(R.drawable.def_pic), "drawable-hdpi",getPackageName());
imgloc = Integer.toString(resID);
public Bitmap getRes(String name) {
ApplicationInfo appInfo = getApplicationInfo();
int resID = getResources().getIdentifier(name, "drawable", appInfo.packageName);
return BitmapFactory.decodeResource(getResources(), resID);}
參考資料:
- 四種存取照片的方法 (SD card/res/src/Assets)
http://mikey-tsu.iteye.com/blog/1061929 - 圖片縮小的方式
http://www.eoeandroid.com/thread-54432-1-1.html - BitmapFactory.decodeFile
http://www.mail-archive.com/android-beginners@googlegroups.com/msg06527.html - getResources().getIdentifier() 參考資料
http://ysl-paradise.blogspot.com/2008/08/resource-id.html
http://wang-peng1.iteye.com/blog/566362
http://hi.baidu.com/cassieli/blog/item/2d58813a60633b2fb8998fd6.html
http://ysl-paradise.blogspot.com/2008/08/resource-id.html - 其他參考資料
http://www.javaworld.com.tw/jute/post/view?bid=26&id=300809
http://androidbiancheng.blogspot.com/2010/06/imageview.html
http://0rz.tw/pkliw
http://0rz.tw/xj0k8
http://0rz.tw/Joh05
2011年8月30日 星期二
訂閱:
文章 (Atom)