10-27-2009 07:21 AM
I want to access an image stored in Blackberry, say at location "store/home/user/image.png" .
Now can i access this image as,
String filePath = "file:///store/home/user/image.png; Bitmap image = Bitmap.getBitmapResource(filePath); BitmapField bitmapField = new BitmapField(image, BitmapField.FOCUSABLE);
OR
I have to access it as,
String filePath = "file:///store/home/user/image.png;
FileConnection fconn = (FileConnection)Connector.open(filePath, Connector.READ);
if (fconn.exists())
{
........
........
input.close();
fconn.close();
}
I am able to access the image using the second way but I want to know that can I access it using "Bitmap.getBitmapResource(filePath)" ?
Solved! Go to Solution.
10-27-2009 07:36 AM
You need to use File connection ...
---
Aditya
10-27-2009 08:43 AM
Thanks.. means I can only access that stored image using my second way (ie. opening the FileConnection, reading the image into byte[] & then converting the byte[] toimage).
am i right?
10-27-2009 08:47 AM
10-27-2009 08:52 AM
Yes.
10-27-2009 10:27 AM - edited 10-27-2009 10:30 AM
Thanks Simon_hain,
Is there any other way than opening FileConnection to access that stored image on filesystem ? as I m accessing that image 2 times. so everytime I m opening FileConnection to read that image. So to avoid this extra overhead is there any other way ?
10-27-2009 10:34 AM
10-27-2009 10:56 AM
ok . but for first time reading is there any way other than opening FileConnection ?
10-27-2009 10:57 AM
10-27-2009 11:12 AM
ok. Thanks a lot..