Decoding jpeg to bmp
| Wed, 2007-10-03 12:24 | |
|
Hello, I am writing a simple piece of code to decode from jpeg to bmp: _LIT(KJPEGFile, "C:\\planet.jpg"); CFbsBitmap* aBitmap = new (ELeave) CFbsBitmap(); When I try to open the planet.bmp file, I get a message that it is not valid. However, when I use the following code, the resulting bitmap _LIT(KJPEGFile, "C:\\planet.jpg"); CFbsBitmap* aBitmap = new (ELeave) CFbsBitmap(); aImageEncoder->Convert(&aStatus, *aBitmap); It just seems a bit strange that i have to use both the decoder and edncoder API's in order to successfully turn a jpg to a bmp, which is just |
|






Forum posts: 1232
windows "bmp" is not a raw bitmap, it has headers and stuff, and might even be compressed (with a simple non-destructive RLE compression)
So there is nothing strange with that the symbian memory bitmap has to be "encoded" into it. (even though the encoding in this case is very simple)
The reason you can't open it after using "Save" is that this function does not save the bitmap in windows "bmp" format, but its own format.
Might be mbm, but I've heard some say otherwise..
CImageEncoder is the class to use if you need a portable format that should work in other operating systems.
Forum posts: 286
Yes CFbsBitmap::Save wil save in mbm format *only*
Cheers,
Sri
Forum posts: 5
Anyone know how I could view an mbm image without having to convert it to some encoded format?
Forum posts: 68
If you want to view it on Windows then Nokia supplies a program called mbmviewer which you can use. The phone's default viewer should be able to display an mbm file as well.
"C:\Symbian\9.1\S60_3rd_MR\S60Tools\mbmviewer\mbmviewer.exe"