Symbian
Symbian OS Library

SYMBIAN OS V9.3

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



Location: GDI.H

Class CBitmapDevice

class CBitmapDevice : public CGraphicsDevice;

Description

Defines an abstract interface for the capabilities and attributes of a bitmapped graphics device.

The class specialises the graphics device interface CGraphicsDevice for bitmaps graphics. The Window Server Client-Side API provides one implementation of the interface, CWsScreenDevice, for screen drawing. Another implementation, CFbsBitmapDevice, is used for drawing to in-memory bitmaps. A third, CFbsScreenDevice, is used (rarely) to access the screen directly, without the mediation of the window server.

Derivation

Members

Defined in CBitmapDevice:
AddFile(), CreateBitmapContext(), FontHeightInPixels(), GetNearestFontInPixels(), GetNearestFontToDesignHeightInPixels(), GetNearestFontToMaxHeightInPixels(), GetPixel(), GetScanLine(), RemoveFile()

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

Inherited from CGraphicsDevice:
CreateContext(), DisplayMode(), FontHeightInTwips(), GetPalette(), NumTypefaces(), PaletteAttributes(), SetPalette(), SizeInPixels(), SizeInTwips(), TypefaceSupport()

Inherited from MGraphicsDeviceMap:
GetNearestFontInTwips(), GetNearestFontToDesignHeightInTwips(), GetNearestFontToMaxHeightInTwips(), HorizontalPixelsToTwips(), HorizontalTwipsToPixels(), PixelsToTwips(), ReleaseFont(), TwipsToPixels(), VerticalPixelsToTwips(), VerticalTwipsToPixels()


Member functions


GetPixel()

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

Description

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

This pure virtual function is implemented in derived classes.

Parameters

TRgb &aColor

On return, should contain the RGB colour of the pixel.

const TPoint &aPixel

The (x,y) co-ordinates of the pixel. The top left pixel is (0,0).


GetScanLine()

virtual void GetScanLine(TDes8 &aBuf, const TPoint &aStartPixel, TInt aLength, TDisplayMode aDispMode) const=0;

Description

Copies a scanline into a buffer.

The pixels are converted from the display mode format on the bitmapped graphics device to the format of the specified device display mode.

By specifying the start pixel and the number of pixels, either the whole or a portion of a bitmapped graphics device pixel row may be copied.

This pure virtual function is implemented in derived classes.

Parameters

TDes8 &aBuf

An 8 bit modifiable descriptor buffer into which pixels are copied; it must be sufficiently large to store all the scanline pixels.

const TPoint &aStartPixel

The (x,y) co-ordinates of the first pixel of the bitmap scanline to be put into the buffer.

TInt aLength

The number of pixels to put into the buffer.

TDisplayMode aDispMode

The display mode into which to convert the pixels.


AddFile()

virtual TInt AddFile(const TDesC &aName, TInt &aId)=0;

Description

Adds a font file to the device's typeface store. The specified font file must be accessible to any process, i.e. not located inside an application's private directory.

This pure virtual function is implemented in derived classes.

Parameters

const TDesC &aName

The name of the font file.

TInt &aId

On return, contains an ID for the font file.

Return value

TInt

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


RemoveFile()

virtual void RemoveFile(TInt aId=0)=0;

Description

Removes a font file from the font store.

This pure virtual function is implemented in derived classes.

Parameters

TInt aId

The ID of the font file to be removed. The default is 0.


GetNearestFontInPixels()

virtual TInt GetNearestFontInPixels(CFont *&aFont, const TFontSpec &aFontSpec)=0;

Description

Gets the font which is the nearest to the given font specification.

Parameters

CFont *&aFont

On return, contains a pointer to the nearest font.

const TFontSpec &aFontSpec

The specification of the font to be matched.

Return value

TInt

KErrNone if successful; a system-wide error code otherwise.


GetNearestFontToDesignHeightInPixels()

inline virtual TInt GetNearestFontToDesignHeightInPixels(CFont *&, const TFontSpec &);

Description

Gets the font which is the nearest to the given font specification. Matching to design height gives no guarantees on the actual physical size of the font.

Parameters

CFont *&

const TFontSpec &

Return value

TInt

KErrNone if successful; a system-wide error code otherwise.


GetNearestFontToMaxHeightInPixels()

inline virtual TInt GetNearestFontToMaxHeightInPixels(CFont *&, const TFontSpec &, TInt);

Description

Gets the font which is the nearest to the given font specification. Matching to maximum height returns a font that will fit within the height specified.

Parameters

CFont *&

const TFontSpec &

TInt

Return value

TInt

KErrNone if successful; a system-wide error code otherwise.


FontHeightInPixels()

virtual TInt FontHeightInPixels(TInt aTypefaceIndex, TInt aHeightIndex) const=0;

Description

Gets the height, in pixels, of the specified typeface at one of its defined heights.

The typeface is identified by by an index. For a given typeface, there are a discrete number of heights; the specific height is also identified by an index.

The value returned is rounded up or down to the nearest font height in pixels.

This pure virtual function is implemented in derived classes.

Parameters

TInt aTypefaceIndex

A typeface index number, in the range: 0 to (NumTypefaces() - 1).

TInt aHeightIndex

A font height index number, in the range: 0 to (iNumHeights - 1) where iNumHeights is a public data member of the TTypefaceSupport object returned by TypefaceSupport().

Return value

TInt

The height of the font, in pixels.

See also:


CreateBitmapContext()

inline TInt CreateBitmapContext(CBitmapContext *&aGC);

Description

Creates a bitmap context for this bitmap device.

Parameters

CBitmapContext *&aGC

On return, holds a pointer to the created bitmap context.

Return value

TInt

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