Welcome!

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

Reply
New Developer
Posts: 34
Registered: ‎09-08-2009
My Device: Not Specified
Accepted Solution

convert of image

hi

 

          I want to convert image from jpeg format to bmp .IS there any way to convert jpeg to bmp.

New Developer
Posts: 34
Registered: ‎09-08-2009
My Device: Not Specified

Re: convert of image

hi to all,

 

                  is there any way please send that information.

Highlighted
Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: convert of image

There is no native function/class. You would need to implement it yourself.

 

One idea: you load the image using the EncodedImage class, it will retain it's formating and if you need to write it out again you can call getData(). You can get the image as a general Bitmap by calling getBitmap(). Use the Bitmap to get the image data, convert it to BMP format, then load it up as a EncodedImage to make sure that it can be read.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
New Developer
Posts: 34
Registered: ‎09-08-2009
My Device: Not Specified

Re: convert of image

hi

 

            Thank you for sending reply.

 

             Can we convert  in to BMP format using Bitmap object.

Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: convert of image

Unfortunately no, the BMP format should be relatively simple so making a writer shouldn't be hard. Just know that an EncodedImage will return an encoded image. a Bitmap will return raw RGB/A color information.

 

A good explanation of the BMP format is actually on Wikipedia: http://en.wikipedia.org/wiki/BMP_file_format

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
New Developer
Posts: 6
Registered: ‎11-01-2009
My Device: Not Specified

Re: convert of image

Hi,

you'd need a licensed routine to do the jpeg decompression.

 

On the other hand I'm interested in the raw sensor data, if anyone here k nows how to get and save that before noise-reduction. At least in bitmap format (to avoid the jpeg compression as well though I'd accept that if I could just get it before the noise-reduction.

 

thanks