Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: w32std.h
Link against: ws32.lib

Class CWsBitmap

CWsBitmap

Support

Supported from 5.0

Description

Window server bitmap.

This is a bitmap to which the window server already has a handle. Functions which take a window server bitmap are faster than equivalent functions which take a CFbsBitmap.

Derivation

CBaseBase class for all classes to be instantiated on the heap
CFbsBitmapA bitmap managed by the font and bitmap server
CWsBitmapWindow server bitmap
MWsClientClassBase class for all classes whose objects are clients of the window server engine

Defined in CWsBitmap:
CWsBitmap(), Create(), Duplicate(), InternalizeL(), Load(), Reset(), ~CWsBitmap()

Inherited from CBase:
operator new()

Inherited from CFbsBitmap:
DataAddress(), DisplayMode(), ExternalizeL(), ExternalizeRectangleL(), GetPalette(), GetPixel(), GetScanLine(), GetVerticalScanLine(), Handle(), Header(), HorizontalPixelsToTwips(), HorizontalTwipsToPixels(), IsFileInRom(), IsLargeBitmap(), IsMonochrome(), IsRomBitmap(), PaletteAttributes(), Resize(), Save(), ScanLineLength(), SetPalette(), SetScanLine(), SetSizeInTwips(), SizeInPixels(), SizeInTwips(), StoreL(), VerticalPixelsToTwips(), VerticalTwipsToPixels()

Inherited from MWsClientClass:
WsHandle()


Construction and destruction


CWsBitmap()

CWsBitmap();

Description

Default constructor. Developers should use the other constructor overload.


CWsBitmap()

CWsBitmap(RWsSession &aWs);

Description

Constructor which takes a window server session as an argument.

Parameters

RWsSession &aWs

Handle to window server session.


~CWsBitmap()

~CWsBitmap();

Description

Destructor.

[Top]


Member functions


Create()

TInt Create(const TSize& aSizeInPixels, TDisplayMode aDispMode);

Description

Creates a bitmap, specifying size and display mode

Parameters

const TSize& aSizeInPixels

The size of the bitmap to be created.

TDisplayMode aDispMode

The display-mode of the bitmap to be created.

Return value

TInt

KErrNone if successful, KErrCouldNotConnect if no connection to the font and bitmap server could be made, KErrArgument if aSizeInPixels is illegal, or an FBS message error

See also:


Duplicate()

TInt Duplicate(TInt aHandle);

Description

Make this bitmap a duplicate of the specified bitmap.

Parameters

TInt aHandle

The handle of the bitmap to be duplicated.

Return value

TInt

KErrNone if successful, KErrCouldNotConnect if no connection to the font and bitmap server could be made, or KErrUnknown if no bitmap could be found whose handle is aHandle.

See also:


InternalizeL()

void InternalizeL(RReadStream& aStream);

Description

Internalises a CWsBitmap from the read stream.

The presence of this function means that the standard templated operator>>() can be used to internalise objects of this class.

Parameters

RReadStream& aStream

The stream from which to internalise the bitmap.


Load()

TInt Load(const TDesC& aFileName,TInt32 aId,TBool aShareIfLoaded=ETrue);

Description

Loads a specified bitmap from file.

If aShareIfLoaded is ETrue the bitmap will be allowed to be shared by a number of font and bitmap server clients.

Parameters

const TDesC& aFileName

The filename of the multibitmap (.mbm) file containing the bitmap to be loaded.

TInt32 aId

The identifier of the bitmap in the .mbm file which should be loaded

TBool aShareIfLoaded=ETrue

Specifies whether or not the loaded bitmap will be made available for sharing between font and bitmap server clients.

Return value

TInt

KErrNone if successful, otherwise KErrCouldNotConnect, KErrEof, or an font and bitmap server error.

See also:


Reset()

void Reset();

Description

Releases the bitmap's handle from the font and bitmap server.

The function also decrements the bitmap's access count in the font and bitmap server. The server-side bitmap is deleted only if the access count for the bitmap decrements to zero.