Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: bmpancli.h
Link against: bmpanim.lib

Class CBitmapFrameData

class CBitmapFrameData : public CBase;

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

Members

Defined in CBitmapFrameData:
Bitmap(), BitmapsOwnedExternally(), IntervalInMilliSeconds(), Mask(), NewL(), NewL(), NewL(), Position(), SetBitmap(), SetBitmapsOwnedExternally(), SetInterval(), SetMask(), SetPosition(), ~CBitmapFrameData()

Inherited from CBase:
Delete(), Extension_(), operator new()


Construction and destruction


~CBitmapFrameData()

IMPORT_C ~CBitmapFrameData();

Description

Destructor.

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


NewL()

static IMPORT_C CBitmapFrameData *NewL();

Description

Creates a new empty frame object.

Return value

CBitmapFrameData *

New CBitmapFrameData object


NewL()

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

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

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

Return value

CBitmapFrameData *

New CBitmapFrameData object


NewL()

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

Description

Creates a new frame object.

It takes ownership of the specified bitmap and mask (if specified), and is assigned the frame duration and position.

Parameters

CFbsBitmap *aBitmap

A pointer to the bitmap to use in the frame.

CFbsBitmap *aMask

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

[Top]


Member functions


SetBitmap()

IMPORT_C 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()

IMPORT_C 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()

IMPORT_C 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()

IMPORT_C void SetInterval(TInt aIntervalInMilliSeconds);

Description

Sets the frame's duration in milliseconds.

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

IMPORT_C void SetBitmapsOwnedExternally(TBool aOwnedExternally);

Description

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

Parameters

TBool aOwnedExternally

If ETrue, the bitmap and mask are specified as being owned externally and the CBitmapFrameData destructor is NOT responsible for destroying the bitmap. If EFalse, the CBitmapFrameData destructor is responsible for destroying the bitmap.


Bitmap()

IMPORT_C 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()

IMPORT_C 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()

IMPORT_C TInt IntervalInMilliSeconds() const;

Description

Gets the frame's duration in milliseconds.

Return value

TInt

The number of milliseconds for which the frame is displayed


Position()

IMPORT_C 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()

IMPORT_C TBool BitmapsOwnedExternally() const;

Description

Tests whether the frame owns the bitmap and mask.

Return value

TBool

ETrue if the bitmap is owned externally, EFalse otherwise.