CBitmapFrameData Class Reference

#include <mw/bmpancli.h>

Link against: bmpanim.lib

class CBitmapFrameData : public CBase

Inherits from

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

Constructor & Destructor Documentation

~CBitmapFrameData ( )

IMPORT_C~CBitmapFrameData()

Destructor.

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

Member Function Documentation

Bitmap ( )

IMPORT_C CFbsBitmap *Bitmap()const

Gets the frame's bitmap.

This does not affect ownership of the bitmap.

Return Value
The frame's bitmap

BitmapsOwnedExternally ( )

IMPORT_C TBoolBitmapsOwnedExternally()const

Tests whether the frame owns the bitmap and mask.

Return Value
ETrue if the bitmap is owned externally, EFalse otherwise.

IntervalInMilliSeconds ( )

IMPORT_C TIntIntervalInMilliSeconds()const

Gets the frame's duration in milliseconds.

Return Value
The number of milliseconds for which the frame is displayed

Mask ( )

IMPORT_C CFbsBitmap *Mask()const

Gets the frame's mask.

This does not affect ownership of the bitmap.

Return Value
The frame's mask

NewL ( )

IMPORT_C CBitmapFrameData *NewL()[static]

Creates a new empty frame object.

Return Value
New CBitmapFrameData object

NewL ( CFbsBitmap *, CFbsBitmap * )

IMPORT_C CBitmapFrameData *NewL(CFbsBitmap *aBitmap,
CFbsBitmap *aMask = NULL
)[static]

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

The object takes ownership of the specified bitmap and mask.

Parameters
aBitmapA pointer to the bitmap to use in the new frame
aMaskIf non-NULL, a pointer to the mask to use in the new frame
Return Value
New CBitmapFrameData object

NewL ( CFbsBitmap *, CFbsBitmap *, TInt, TPoint )

IMPORT_C CBitmapFrameData *NewL(CFbsBitmap *aBitmap,
CFbsBitmap *aMask,
TIntaIntervalInMilliSeconds,
TPointaPosition
)[static]

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
aBitmapA pointer to the bitmap to use in the frame.
aMaskIf non-NULL, a pointer to the mask to use in the frame.
aIntervalInMilliSecondsThe frame's duration in milliseconds.
aPositionThe frame's position relative to the animation window.
Return Value
New CBitmapFrameData object

Position ( )

IMPORT_C TPointPosition()const

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

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

SetBitmap ( CFbsBitmap * )

IMPORT_C voidSetBitmap(CFbsBitmap *aBitmap)

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
aBitmapThe frame bitmap

SetBitmapsOwnedExternally ( TBool )

IMPORT_C voidSetBitmapsOwnedExternally(TBoolaOwnedExternally)

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

Parameters
aOwnedExternallyIf 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.

SetInterval ( TInt )

IMPORT_C voidSetInterval(TIntaIntervalInMilliSeconds)

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
aIntervalInMilliSecondsThe number of milliseconds to display the frame

SetMask ( CFbsBitmap * )

IMPORT_C voidSetMask(CFbsBitmap *aMask)

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
aMaskMask to use in the frame

SetPosition ( TPoint )

IMPORT_C voidSetPosition(TPointaPosition)

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

Parameters
aPositionThe frame's position relative to the animation window