Reading a frame from a GIF image using Symbian C++
Article Metadata
Compatibility
S60 2nd Edition
Article
Overview
Reading a frame from a GIF image
Description
How can I read a frame from a GIF image (animated GIF with several frames)?
The following source code demonstrates how to modify the Bmpmanip example to read a required frame from a GIF image file.
Open the CBmpmanipAppView implementation included in the S60 SDK (\Series60Ex\bmpmanip\src\bmpmanipappview.cpp) and modify it as follows:
TFrameInfo frameInfo;
// Find the desired frame from the GIF
// image and assign it to gifFrameIndex
// Get the frame info
iConverter->FrameInfo(gifFrameIndex, frameInfo);
// Create a bitmap based on the size of the gif
TInt err = iBitmap->Create(frameInfo.iOverallSizeInPixels,
KDeviceColourDepth);
if (err == KErrCouldNotConnect)
{
// handle errors
}
// Convert the GIF frame into a bitmap
TRAPD(convertErr, iConverter->ConvertL(*iBitmap, gifFrameIndex));


(no comments yet)