Reading a frame from a GIF image using Symbian C++

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Platform(s): S60 1st Edition
S60 2nd Edition
S60 2nd Edition (initial release)
S60 1st Edition
Created: User:Technical writer 2 (10 Feb 2004)
Last edited: lpvalente (15 Jun 2013)


Reading a frame from a GIF image.


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,
if (err == KErrCouldNotConnect)
// handle errors
// Convert the GIF frame into a bitmap
TRAPD(convertErr, iConverter->ConvertL(*iBitmap, gifFrameIndex));
This page was last modified on 15 June 2013, at 22:03.
61 page views in the last 30 days.