public
Bitmap getImage(){
Bitmap bitmapImage=
null
;
try
{
InputStream input;
FileConnection fconn = (FileConnection) Connector.open(
"file:///store/home/user/dirname/imgname.png"
, Connector.READ_WRITE);
input = fconn.openInputStream();
ByteArrayOutputStream baos =
new
ByteArrayOutputStream();
int
j =
0
;
while
((j=input.read()) != -
1
) {
baos.write(j);
}
byte
[] byteArray = baos.toByteArray();
bitmapImage = Bitmap.createBitmapFromBytes(byteArray,
0
,byteArray.length,
1
);
}
catch
(Exception ioe){
System.out.println(ioe);
}
return
bitmapImage;
}
No comments:
Post a Comment