1. Shreyas's Avatar
    I want to access an image stored in Blackberry, say at location "store/home/user/image.png" .

    Now can i access this image as,

    Code:
    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,

    Code:
    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)" ?
    10-27-09 06:23 AM
  2. Smiley88's Avatar
    I want to access an image stored in Blackberry, say at location "store/home/user/image.png" .

    Now can i access this image as,

    Code:
    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,

    Code:
    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)" ?
    you can't use the first method because getBitmapResource() reads the bitmap from the cod file. You have to use file connection like in your 2nd method.
    10-28-09 12:01 AM
  3. Shreyas's Avatar
    Thanks a lot for the reply ....
    10-28-09 01:26 AM
LINK TO POST COPIED TO CLIPBOARD