Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Regular Contributor
Posts: 70
Registered: ‎04-14-2010
My Device: bold 9000
My Carrier: new
Accepted Solution

how to load image to memory

i want to get jpg from my webcam


yesterday thanks to you

i loaded jpg to simulator

,but it was imported to java project res


how can i load jpg to memory and read it from memory in bb ?


if you know some post ,or do you know it

plz warm answer   T T




Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: how to load image to memory

This article will tell you how to read the jpg in your project into memory.


How To - Add plain text or binary files to an application
Article Number: DB-00148

Then you need to convert the bytes into something the BlackBerry can process.  To do this you use:



Now you get to get a Bitmap, which the form that the BlackBerry uses to display images on  the screen.  This encodedImage object you will have created in the previous step and be used to get the bitmap, just use the




Now the BlackBerry display Fields on the screen, so you need to create a Field to display this, a BitmapField and tell it to use the bitmap you have just created.  This is easy, you just construct a new BitmapField:

BitmapField(Bitmap bitmap)


Finally you add the BitmapField to the screen you are displaying.


There are shorter ways of doing this if you create png rather than jpg images.