04-15-2010 05:50 AM
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
Solved! Go to Solution.
04-15-2010 06:30 AM
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
http://www.blackberry.com/knowledgecenterpublic/li
Then you need to convert the bytes into something the BlackBerry can process. To do this you use:
EncodedImage.createEncodedImage(..);
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
getBitmap()
method
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.