×
Namespaces

Variants
Actions

Image Encoding

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
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
User::LeaveIfError(iFrameImageData->AppendImageData(imageData));
 
// 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 08:07.
33 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.

×