Symbian
 Developer Library

DEVELOPER LIBRARY

[Index] [Glossary] [Previous] [Next]



Location: bmpancli.h
Link against: bmpanim.lib

Class CBitmapFrameData

class CBitmapFrameData : public CBase;

Support

Supported from 6.0

Description

Encapsulates the information required for one frame of an animation.

Each animation frame includes a bitmap that is displayed in a specified position for a specified length of time. You can optionally include a mask that either hides part of the bitmap, or that makes part of the bitmap transparent so that the background can be seen.

You will probably need to define several frames for a complete animation. When you have defined the frames you require, use CBitmapAnimClientData to construct the animation itself.

Derivation

CBaseBase class for all classes to be instantiated on the heap
CBitmapFrameDataEncapsulates the information required for one frame of an animation

Defined in CBitmapFrameData:
Bitmap(), BitmapsOwnedExternally(), CBitmapFrameData(), IntervalInMilliSeconds(), Mask(), NewL(), NewL(), NewL(), Position(), SetBitmap(), SetBitmapsOwnedExternally(), SetInterval(), SetMask(), SetPosition(), iBitmap, iBitmapsOwnedExternally, iIntervalInMilliSeconds, iMaskBitmap, iPosition, ~CBitmapFrameData()

Inherited from CBase:
operator new()


Construction and destruction


NewL()

static CBitmapFrameData* NewL();

Description

Creates a new empty frame object.

Return value

CBitmapFrameData*

New CBitmapFrameData object


NewL()

static CBitmapFrameData* NewL(CFbsBitmap* aBitmap, CFbsBitmap* aMask=NULL);

Description

Creates a new frame object with a specified bitmap and (optionally) a mask.

The object takes ownership of the specified bitmap and mask.

Parameters

CFbsBitmap* aBitmap

A pointer to the bitmap to use in the new frame

CFbsBitmap* aMask=NULL

If non-NULL, a pointer to the mask to use in the new frame

Return value

CBitmapFrameData*

New CBitmapFrameData object


NewL()

static CBitmapFrameData* NewL(CFbsBitmap* aBitmap, CFbsBitmap* aMask, TInt aIntervalInMilliSeconds, TPoint aPosition);

Description

Creates a new frame object that:

Parameters

CFbsBitmap* aBitmap

A pointer to the bitmap to use in the frame.

CFbsBitmap* aMask=NULL

If non-NULL, a pointer to the mask to use in the frame.

TInt aIntervalInMilliSeconds

The frame's duration in milliseconds.

TPoint aPosition

The frame's position relative to the animation window.

Return value

CBitmapFrameData*

New CBitmapFrameData object


~CBitmapFrameData()

~CBitmapFrameData();

Description

Destructor.

It deletes the bitmap and mask objects owned by the frame unless the "owned externally" (SetBitmapsOwnedExternally()) flag is set.

[Top]


Member functions


SetBitmap()

void SetBitmap(CFbsBitmap* aBitmap);

Description

Sets the frame bitmap.

Unless the "owned externally" (SetBitmapsOwnedExternally()) flag is set, it deletes any existing frame bitmap and takes ownership of the new bitmap.

Parameters

CFbsBitmap* aBitmap

The frame bitmap


SetMask()

void SetMask(CFbsBitmap* aMask);

Description

Sets the frame mask.

Unless the "owned externally" (SetBitmapsOwnedExternally()) flag is set, it deletes any existing mask bitmap and takes ownership of the new bitmap.

Parameters

CFbsBitmap* aMask

Mask to use in the frame


SetPosition()

void SetPosition(TPoint aPosition);

Description

Sets the frame's position relative to the animation window.

Parameters

TPoint aPosition

The frame's position relative to the animation window


SetInterval()

void SetInterval(TInt aIntervalInMilliSeconds);

Description

Sets for how many milliseconds the frame is displayed.

You can alternatively set the interval for a complete animation using CBitmapAnimClientData::SetFrameInterval(). However, an interval set for an individual frame overrides any interval set at the animation level.

Parameters

TInt aIntervalInMilliSeconds

The number of milliseconds to display the frame


SetBitmapsOwnedExternally()

void SetBitmapsOwnedExternally(TBool aOwnedExternally);

Description

Sets whether the bitmap and mask are owned by the frame.

Use this function to take, or discard, ownership of a frame bitmap and mask.

Parameters

TBool aOwnedExternally

If EFalse, the bitmap and mask are specified as being owned by the frame. If ETrue, the bitmap and mask are specified as not being owned by the frame.


Bitmap()

CFbsBitmap* Bitmap() const;

Description

Gets the frame's bitmap.

This does not affect ownership of the bitmap.

Return value

CFbsBitmap*

The frame's bitmap


Mask()

CFbsBitmap* Mask() const;

Description

Gets the frame's mask.

This does not affect ownership of the bitmap.

Return value

CFbsBitmap *

The frame's mask


IntervalInMilliSeconds()

TInt IntervalInMilliSeconds() const;

Description

Gets the length of time for which the frame is displayed.

The time is expressed in milliseconds.

Return value

TInt

The number of milliseconds for which the frame is displayed


Position()

TPoint Position() const;

Description

Gets the frame's position, relative to the animation window.

Return value

TPoint

The frame's position, relative to the animation window.


BitmapsOwnedExternally()

TBool BitmapsOwnedExternally() const;

Description

Tests whether the frame owns the bitmap, and mask, that is associated with the frame.

Return value

TBool

ETrue if the frame owns the bitmap and mask, otherwise EFalse.

[Top]


Internal members


CBitmapFrameData()

private: CBitmapFrameData();

Description

This member is internal and not intended for use.


iBitmap

private: CFbsBitmap* iBitmap;

Description

This member is internal and not intended for use.


iMaskBitmap

private: CFbsBitmap* iMaskBitmap;

Description

This member is internal and not intended for use.


iBitmapsOwnedExternally

private: TBool iBitmapsOwnedExternally;

Description

This member is internal and not intended for use.


iIntervalInMilliSeconds

private: TInt iIntervalInMilliSeconds;

Description

This member is internal and not intended for use.


iPosition

private: TPoint iPosition;

Description

This member is internal and not intended for use.