Symbian
Symbian OS Library

FAQ-0765 Why does CMdaImageUtility::FrameCount() return the wrong number of frames?

[Index][spacer] [Previous] [Next]



 

Classification: C++ Category: Documentation
Created: 01/17/2002 Modified: 01/17/2002
Number: FAQ-0765
Platform: Symbian OS v6.0, Symbian OS v6.1

Question:
The documentation for CMdaImageUtility::FrameCount() says that the return value is:
"TInt The number of frames in the image" .
However it doesn't always return the correct number of frames. Why is this?


Answer:
Unfortunately, the documentation is wrong

The return value is not the number of frames in the image. It is the number of frames from the first frame, to the next frame to be decoded. So if you are on the first frame, and there is another frame to decode then the function returns 2. If you are on the fifth frame and there is at least one more frame to decode then the function returns 6. If you are on the fifth frame and there is no more frames to decode then it will return 5.

And even more critical, the function doesn't return a meaningful value until after the current frame has been decoded. So if you call OpenL on the first frame then FrameCount will return 1 no matter how many frames there are in the image. It will only return 2 when the image has been decoded.