Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <BITDEV.H>

Class CFbsBitmapDevice

class CFbsBitmapDevice : public CFbsDevice;

Description

A graphics device to which a bitmap managed by the font and bitmap server can be drawn.

The class specialises the bitmap graphics device interface CBitmapDevice for drawing to in-memory bitmaps.

Derivation

Members

Defined in CFbsBitmapDevice:

Inherited from CBase:

Inherited from CBitmapDevice:

Inherited from CFbsDevice:

Inherited from MGraphicsDeviceMap:


Construction and destruction


NewL(CFbsBitmap *)

IMPORT_C static CFbsBitmapDevice* NewL(CFbsBitmap *aFbsBitmap);

Description

Allocates and constructs the device with the bitmap. Also creates a 2D graphics accelerator which is owned and used by the device.

Parameters

CFbsBitmap *aFbsBitmap

A pointer to the font and bitmap server managed bitmap.

Return value

CFbsBitmapDevice *

A pointer to the newly constructed device.

Leave codes

KErrArgument

The bitmap's handle is zero.

KErrAccessDenied

The bitmap is in the ROM.

Panic codes

EBitgdiPanicInvalidBitmap

aFbsBitmap is NULL.


NewL(CFbsBitmap *,const TDesC &)

IMPORT_C static CFbsBitmapDevice* NewL(CFbsBitmap *aFbsBitmap, const TDesC &aLibname);

Description

Constructs the object from the specified Font and Bitmap server managed bitmap.

Parameters

CFbsBitmap *aFbsBitmap

A pointer to a Font and Bitmap server managed bitmap.

const TDesC16 &aLibname

Name of the library to create the low-level CFbsDrawDevice object from.

Return value

CFbsBitmapDevice *

A pointer to the newly constructed graphics device.


~CFbsBitmapDevice()

IMPORT_C virtual ~CFbsBitmapDevice();

Description

Frees all resources owned by the object prior to its destruction.

[Top]


Member functions


Resize(const TSize &)

IMPORT_C TInt Resize(const TSize &aSize);

Description

Resizes the device.

Parameters

const TSize &aSize

The new size in pixels.

Return value

TInt

KErrNone, if successful; otherwise another of the system-wide error codes.


GetScanLine(TDes8 &,const TPoint &,TInt,TDisplayMode)const

IMPORT_C virtual void GetScanLine(TDes8 &aBuf, const TPoint &aStartPixel, TInt aLength, TDisplayMode iDispMode) const;

Description

Copies a scanline into a buffer.

The function provides a concrete implementation of the pure virtual function CBitmapDevice::GetScanLine(TDes8 &,const TPoint &,TInt,TDisplayMode)const.

Parameters

TDes8 &aBuf

const TPoint &aStartPixel

TInt aLength

TDisplayMode iDispMode


GetPixel(TRgb &,const TPoint &)const

IMPORT_C virtual void GetPixel(TRgb &aColor, const TPoint &aPixel) const;

Description

Gets the RGB colour of an individual pixel on a bitmapped graphics device.

The function provides a concrete implementation of the pure virtual function CBitmapDevice::GetPixel(TRgb &,const TPoint &)const.

Parameters

TRgb &aColor

const TPoint &aPixel


HorizontalPixelsToTwips(TInt)const

IMPORT_C virtual TInt HorizontalPixelsToTwips(TInt aPixels) const;

Description

Converts a horizontal dimension of a device in pixels to a horizontal dimension in twips.

The function provides a concrete implementation of the pure virtual function MGraphicsDeviceMap::HorizontalPixelsToTwips(TInt)const.

Parameters

TInt aPixels

Return value

TInt


VerticalPixelsToTwips(TInt)const

IMPORT_C virtual TInt VerticalPixelsToTwips(TInt aPixels) const;

Description

Converts a vertical dimension of a device in pixels to a vertical dimension in twips.

The function provides a concrete implementation of the pure virtual function MGraphicsDeviceMap::VerticalPixelsToTwips(TInt)const.

Parameters

TInt aPixels

Return value

TInt


HorizontalTwipsToPixels(TInt)const

IMPORT_C virtual TInt HorizontalTwipsToPixels(TInt aTwips) const;

Description

Converts a horizontal dimension of a device in twips to a horizontal dimension in pixels.

The function provides a concrete implementation of the pure virtual function MGraphicsDeviceMap::HorizontalTwipsToPixels(TInt)const.

Parameters

TInt aTwips

Return value

TInt


VerticalTwipsToPixels(TInt)const

IMPORT_C virtual TInt VerticalTwipsToPixels(TInt aTwips) const;

Description

Converts a vertical dimension of a device in twips to a vertical dimension in pixels.

The function provides a concrete implementation of the pure virtual function MGraphicsDeviceMap::VerticalTwipsToPixels(TInt)const.

Parameters

TInt aTwips

Return value

TInt


SizeInTwips()const

IMPORT_C virtual TSize SizeInTwips() const;

Description

Gets the size of the device, in twips.

Return value

TSize

The size of the device.


PaletteAttributes(TBool &,TInt &)const

IMPORT_C virtual void PaletteAttributes(TBool &aModifiable, TInt &aNumEntries) const;

Description

Gets the palette attributes of the device.

The function provides a concrete implementation of the pure virtual function CGraphicsDevice::PaletteAttributes(TBool &,TInt &)const.

Parameters

TBool &aModifiable

TInt &aNumEntries


SetPalette(CPalette *)

IMPORT_C virtual void SetPalette(CPalette *aPalette);

Description

Sets the device's palette to the specified palette.

The function provides a concrete implementation of the pure virtual function CGraphicsDevice::SetPalette(CPalette *).

Parameters

CPalette *aPalette


GetPalette(CPalette *&)const

IMPORT_C virtual TInt GetPalette(CPalette *&aPalette) const;

Description

Gets the device's current palette.

The function provides a concrete implementation of the pure virtual function CGraphicsDevice::GetPalette(CPalette *&)const.

Parameters

CPalette *&aPalette

Return value

TInt


DrawingBegin(TBool)

IMPORT_C virtual void DrawingBegin(TBool aAlways=EFalse);

Description

This method is called when you are about to start direct drawing to the bitmap memory. Calls to CFbsBitmapDevice::DrawingBegin(TBool) must be paired with a subsequent call to CFbsBitmapDevice::DrawingEnd(TBool). Also, code must not leave between a CFbsBitmapDevice::DrawingBegin(TBool) - CFbsBitmapDevice::DrawingEnd(TBool) pair.

Parameters

TBool aAlways

Not used.

See also:


DrawingEnd(TBool)

IMPORT_C virtual void DrawingEnd(TBool aAlways=EFalse);

Description

This method is called when you have finished direct drawing to the bitmap memory. Calls to CFbsBitmapDevice::DrawingEnd(TBool) must correspond to a prior call to CFbsBitmapDevice::DrawingBegin(TBool).

Parameters

TBool aAlways

Not used.

See also:


SwapWidthAndHeight()

IMPORT_C TInt SwapWidthAndHeight();

Description

The method swaps bitmap device's width and height. For example: if the size is (40, 20), the swapped size will be (20, 40). The device's content is not preserved. The method leaves CFbsBitmapDevice object in a consistent state - scaling settings will be set with their default values (the scaling is switched off), the device's dither origin will be set to (0,0), scaling origin to (0,0).

Note: If the device was scaled or its dither origin was set with a non-default value, it has to be rescaled again, respectivelly the dither origin has to be set again.

Note: All graphics contexts, already created by the device, should be re-activated calling CFbsBitGc::Activate(CFbsDevice *).

Note: Do not call CFbsBitmapDevice::SwapWidthAndHeight() between CFbsBitmapDevice::DrawingBegin(TBool) and CFbsBitmapDevice::DrawingEnd(TBool) calls!

Return value

TInt

KErrNone The call was successfull. KErrAccessDenied ROM bitmap size can't be swapped. KErrNotSupported Hardware bitmap size can't be swapped. KErrGeneral iDrawDevice or iFbsBmp is NULL.


SetBits()

private: virtual void SetBits();

Description

Sets the bit level.