Namespaces
Variants
Actions

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

Jump to: navigation, search



Article Metadata

Compatibility
Platform(s): S60 1st Edition
S60 2nd Edition

Article
Created: User:Technical writer 2 (10 Feb 2004)
Last edited: hamishwillee (14 Jun 2012)

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));

This page was last modified on 14 June 2012, at 07:34.
96 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved