Resource res=gerResource();
Drawable drawable=res.getDrawable(id);
Resource res=gerResource();
Bitmap bitmap=BitmapFactory.decodeResource(res, id);
int
id =
int
id =res.getIdentifier(name, defType, defPackage);
AssetManager asm=getAssetMg();
InputStream is=asm.open(name);
Drawable da = Drawable.createFromStream(is,
null
);
Bitmap bitmap=BitmapFactory.decodeStream(is);
String path = Environment.getExternalStorageDirectory().toString()+
"/DCIM/device.png"
;
RandomAccessFile mMiniThumbFile;
File imgfile =
new
File(path);
try
{
mMiniThumbFile =
new
RandomAccessFile(imgfile,
"rw"
);
}
catch
(IOException ex) {
try
{
mMiniThumbFile =
new
RandomAccessFile(imgfile,
"r"
);
}
catch
(IOException ex2) {
System.out.println(ex2.toString());
}
}
data=
new
byte
[
10553
];
try
{
mMiniThumbFile.seek(
0
);
int
got = mMiniThumbFile.read(data,
0
,
10552
);
System.out.println(
"got="
+got);
}
catch
(IOException e) {
e.printStackTrace();
System.out.println(e.toString());
}
if
(data !=
null
) {
Bitmap bitmap = BitmapFactory.decodeByteArray(data,
0
,data.length);