BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 09-02-2009, 01:42 AM   #1
Shreyas
Knows Where the Search Button Is
 
Join Date: Sep 2009
Model: Strom
PIN: N/A
Carrier: Vodafone
Posts: 28
Question Problem in saving a Bitmap image in Blackberry Storm 9500.

Please Login to Remove!

Hi all,

I m saving Bitmap image like..

Code:
private void saveBitmap(int picIndex, Bitmap bmp) 
{
   try
   {
     String PHOTO_DIR = System.getProperty ("fileconn.dir.photos"); 
     String EXTENSION = ".bmp";
     String filePath = PHOTO_DIR + picIndex + EXTENSION;
     
     FileConnection fconn = (FileConnection)Connector.open(filePath, 
                                   Connector.READ_WRITE); 

     if(!fconn.exists())
         fconn.create();

     OutputStream outputStream = fconn.openOutputStream();
     
     // bitmap to byte array conversion    
     PNGEncoder encoder = new PNGEncoder(bmp, true);
     byte[] bitmapBuffer = encoder.encode(true);
            
     outputStream.write(bitmapBuffer);
     outputStream.close();
     fconn.close();
  }
  catch(Exception e)
  {
     System.out.println("  Exception while saving Bitmap:: 
                "+e.toString());
     e.getMessage();
  }
}
, the bimap is saved in Media->Pictures->Pictures Folder->1.bmp

but when clicked on it to view, error comes on console as

Code:
Unable to create EncodedImage for: /store/home/user/pictures/1.bmp
I m working in Blackberry JDE 4.7.0.41 & tested in Blackberry 9500, 9530 Simulators & Strom 9500 device but its not working. The same above problem is coming.

Not getting what may be the problem. Plz suggest.
Offline  
Old 09-02-2009, 11:33 PM   #2
Shreyas
Knows Where the Search Button Is
 
Join Date: Sep 2009
Model: Strom
PIN: N/A
Carrier: Vodafone
Posts: 28
Question

I m saving the image as my previous code.

It is saved in Media->Pictures->Device Memory->1.bmp but when clicked on it error comes as "Unable to create Encoded Image for ..." as I told in my previous post.
I tested this in 9500 Simulator & Storm 9500. Now I accessed that saved image through another project by adding that image in BitmapField & adding it on Screen. Its coming properly. I tested this in 9500 Simulator & Storm 9500.

Then dont know why its not getting displayed in Media->Pictures->Device Memory->1.bmp.

Do anyone know the answer for this?
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


OEM Battery for MacBook Pro 17

OEM Battery for MacBook Pro 17" A1309 A1297 Early 2009 Mid 2009 2010 MC226

$40.90



Genuine A1417 OEM Battery Apple Macbook Pro 15 Retina A1398 Mid 2012 Early 2013 picture

Genuine A1417 OEM Battery Apple Macbook Pro 15 Retina A1398 Mid 2012 Early 2013

$37.90



NEW OEM Battery A1466 A1369 A1496 A1405 A1377 A1466 for MacBook Air 13 inch picture

NEW OEM Battery A1466 A1369 A1496 A1405 A1377 A1466 for MacBook Air 13 inch

$31.90



iPhone 13 12 11 PRO MAX XR XS 8/7/6 Fast Charger USB Data Cable cord 10 feet/3M picture

iPhone 13 12 11 PRO MAX XR XS 8/7/6 Fast Charger USB Data Cable cord 10 feet/3M

$4.99



A1618 NEW OEM Battery for MacBook Pro 15

A1618 NEW OEM Battery for MacBook Pro 15" Retina A1398 Mid 2015 020-00079

$43.90



Genuine OEM A1417 Battery For Apple Macbook Pro 15

Genuine OEM A1417 Battery For Apple Macbook Pro 15" Retina A1398 2012 2013 NEW

$38.90







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.