Symbian
Symbian OS Library

SYMBIAN OS V9.3

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



Location: BITDEV.H
Link against: bitgdi.lib

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:
DrawingBegin(), DrawingEnd(), GetPalette(), GetPixel(), GetScanLine(), HorizontalPixelsToTwips(), HorizontalTwipsToPixels(), NewL(), NewL(), PaletteAttributes(), Resize(), SetBits(), SetPalette(), SizeInTwips(), SwapWidthAndHeight(), VerticalPixelsToTwips(), VerticalTwipsToPixels(), ~CFbsBitmapDevice()

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

Inherited from CBitmapDevice:
CreateBitmapContext()

Inherited from CFbsDevice:
AddFile(), CancelSprite(), CreateContext(), DisplayMode(), DisplayMode16M(), FontHeightInPixels(), FontHeightInTwips(), GetDrawRect(), GetFontById(), GetNearestFontInPixels(), GetNearestFontInTwips(), GetNearestFontToDesignHeightInPixels(), GetNearestFontToDesignHeightInTwips(), GetNearestFontToMaxHeightInPixels(), GetNearestFontToMaxHeightInTwips(), GraphicsAccelerator(), HideSprite(), NumTypefaces(), Orientation(), RectCompare(), ReleaseFont(), RemoveFile(), SetCustomPalette(), SetScalingFactor(), ShowSprite(), SizeInPixels(), TypefaceSupport(), iBitBltMaskedBuffer, iDrawDevice, iFbs, iGraphicsAccelerator, iOrientation, iScreenDevice, iSpare, iTypefaceStore

Inherited from MGraphicsDeviceMap:
PixelsToTwips(), TwipsToPixels()


Construction and destruction


NewL()

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

static IMPORT_C 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 TDesC &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()

virtual IMPORT_C ~CFbsBitmapDevice();

Description

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

[Top]


Member functions


Resize()

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

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

Parameters

TDes8 &aBuf

const TPoint &aStartPixel

TInt aLength

TDisplayMode iDispMode


GetPixel()

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

Parameters

TRgb &aColor

const TPoint &aPixel


HorizontalPixelsToTwips()

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

Parameters

TInt aPixels

Return value

TInt


VerticalPixelsToTwips()

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

Parameters

TInt aPixels

Return value

TInt


HorizontalTwipsToPixels()

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

Parameters

TInt aTwips

Return value

TInt


VerticalTwipsToPixels()

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

Parameters

TInt aTwips

Return value

TInt


SizeInTwips()

virtual IMPORT_C TSize SizeInTwips() const;

Description

Gets the size of the device, in twips.

Return value

TSize

The size of the device.


PaletteAttributes()

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

Parameters

TBool &aModifiable

TInt &aNumEntries


SetPalette()

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

Parameters

CPalette *aPalette


GetPalette()

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

Parameters

CPalette *&aPalette

Return value

TInt


DrawingBegin()

virtual IMPORT_C void DrawingBegin(TBool aAlways=EFalse);

Description

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

Parameters

TBool aAlways

Not used.

See also:


DrawingEnd()

virtual IMPORT_C void DrawingEnd(TBool aAlways=EFalse);

Description

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

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

Note: Do not call SwapWidthAndHeight() between DrawingBegin() and DrawingEnd() 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.