Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <GDI.H>
Link against: gdi.lib

Class MGraphicsDeviceMap

class MGraphicsDeviceMap;

Description

Interface class for mapping between twips and device-specific units (pixels).

TZoomFactor is derived from MGraphicsDeviceMap.

Members

Defined in MGraphicsDeviceMap:

See also:


Construction and destruction


MGraphicsDeviceMap()

IMPORT_C MGraphicsDeviceMap();

Description

Default constructor.


~MGraphicsDeviceMap()

IMPORT_C virtual ~MGraphicsDeviceMap();

Description

Destructor.

[Top]


Member functions


TwipsToPixels(const TPoint &)const

IMPORT_C TPoint TwipsToPixels(const TPoint &aTwipPoint) const;

Description

Converts a point in twips to a point in pixels.

Parameters

const TPoint &aTwipPoint

A point on the graphics device in twips.

Return value

TPoint

A point on the graphics device in pixels.


TwipsToPixels(const TRect &)const

IMPORT_C TRect TwipsToPixels(const TRect &aTwipRect) const;

Description

Converts a rectangle in twips to a rectangle in pixels.

Parameters

const TRect &aTwipRect

A rectangle on the graphics device in twips

Return value

TRect

A rectangle on the graphics device in pixels.


PixelsToTwips(const TPoint &)const

IMPORT_C TPoint PixelsToTwips(const TPoint &aPixelPoint) const;

Description

Converts a point in pixels to a point in twips.

Parameters

const TPoint &aPixelPoint

A point on the graphics device in pixels.

Return value

TPoint

A point on the graphics device in twips.


PixelsToTwips(const TRect &)const

IMPORT_C TRect PixelsToTwips(const TRect &aPixelRect) const;

Description

Converts a rectangle in pixels to a rectangle in twips.

Parameters

const TRect &aPixelRect

A rectangle on the graphics device in pixels.

Return value

TRect

A rectangle on the graphics device in twips.


HorizontalTwipsToPixels(TInt)const

virtual TInt HorizontalTwipsToPixels(TInt aTwips) const=0;

Description

Converts a horizontal dimension from twips to pixels.

An implementation is supplied by a derived class.

Parameters

TInt aTwips

A horizontal dimension of a device in twips.

Return value

TInt

A horizontal dimension of a device in pixels.


VerticalTwipsToPixels(TInt)const

virtual TInt VerticalTwipsToPixels(TInt aTwips) const=0;

Description

Converts a vertical dimension from twips to pixels.

An implementation is supplied by a derived class.

Parameters

TInt aTwips

A vertical dimension of a device in twips.

Return value

TInt

A vertical dimension of a device in pixels.


HorizontalPixelsToTwips(TInt)const

virtual TInt HorizontalPixelsToTwips(TInt aPixels) const=0;

Description

Converts a horizontal dimension from pixels to twips.

An implementation is supplied by a derived class.

Parameters

TInt aPixels

A horizontal dimension of a device in pixels.

Return value

TInt

A horizontal dimension of a device in twips.


VerticalPixelsToTwips(TInt)const

virtual TInt VerticalPixelsToTwips(TInt aPixels) const=0;

Description

Converts a vertical dimension from pixels to twips.

An implementation is supplied by a derived class.

Parameters

TInt aPixels

A vertical dimension of a device in pixels.

Return value

TInt

A vertical dimension of a device in twips.


GetNearestFontInTwips(CFont *&,const TFontSpec &)

Interface status: deprecated Use GetNearestFontToDesignHeightInTwips

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

Description

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

When the font is no longer needed, call ReleaseFont() .

Note that this deprecated function is replaced by the new GetNearestFontToDesignHeightInTwips() yielding (virtually) the same result. However clients are strongly encouraged to use the new GetNearestFontToMaxHeightInTwips() function instead. This will guarantee that every character within any given text string will fit within the given amount of twips, whereas the design height is an aesthetic unit decided by the font designer without strict physical meaning, which may result in cropped characters.

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.


GetNearestFontToDesignHeightInTwips(CFont *&,const TFontSpec &)

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

Description

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

When the font is no longer needed, call ReleaseFont() .

This new function replaces the deprecated GetNearestFontInTwips() yielding (virtually) the same result. However clients are strongly encouraged to use the new GetNearestFontToMaxHeightInTwips() function instead. This will guarantee that every character within any given text string will fit within the given amount of twips, whereas the design height is an aesthetic unit decided by the font designer without strict physical meaning, which may result in cropped characters.

Parameters

CFont *&

const TFontSpec &

Return value

TInt

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


GetNearestFontToMaxHeightInTwips(CFont *&,const TFontSpec &,TInt)

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

Description

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

When the font is no longer needed, call ReleaseFont() .

The font and bitmap server returns a pointer to the nearest matching font from those available. Matches to max height of font - this does its best to return a font that will fit within the maximum height specified (but note that variations due to hinting algorithms may rarely result in this height being exceeded by up to one pixel). Problems can also be encountered with bitmap fonts where the typeface exists but doesn't have a font small enough.

Parameters

CFont *&

const TFontSpec &

TInt

Return value

TInt

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


ReleaseFont(CFont *)

virtual void ReleaseFont(CFont *aFont)=0;

Description

Releases the specified font.

It is used to indicate that the specified font is no longer needed for use by the device map. As fonts can be shared between applications, this function does not delete the copy of the font from RAM unless the font was only being used by this particular device map.

An implementation is supplied by a derived class.

Parameters

CFont *aFont

A pointer to the font to be released.