Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Image Encoding

From Wiki
Jump to: navigation, search
Article Metadata
Created: eswar_illuri (25 Mar 2008)
Last edited: hamishwillee (14 Jun 2013)

Using CImageEncoder class we can save images originating from the screen and photos from camera, etc. to files or descriptors. This process is in two stages:

Object Creation

Creation of encoder object is synchronous operation and is performed using the constructors FileNewL() or DataNewL().

The FileNewL() constructor is used when converting image data that is to be saved to file. And DataNewL() constructor is used when converting image data that is to be saved to descriptor.

Object Conversion

Before converting image data, we need to the destination image format specific data using CFrameImageData. And using Convert() method we can convert the image to destination image format. Following is the code snippet for convert the image

TJpegImageData * imageData = new (ELeave) TJpegImageData;
// Set some format specific data
imageData->iSampleScheme = TJpegImageData::EColor444;
imageData->iQualityFactor = 95;
iFrameImageData = CFrameImageData::NewL();
// frameData - ownership passed to iFrameImageData after AppendImageData
// Do the convert
iEncoder->Convert(iRequesStatus,iFrameBitmap,(const CFrameImageData*) iFrameImageData);
// Note: the convert function is asynchronous.
// If you use descriptor as target for convertion, call the SetActive()
// after iEncoder->Convert() and catch the end of convertion with RunL()
// (i.e. use the CActive stuff)
This page was last modified on 14 June 2013, at 05:07.
26 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.