|
||
class CBitmapDevice : public CGraphicsDevice;
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.
MGraphicsDeviceMap
- Interface class for mapping between twips and device-specific units (pixels).
CBase
-
Base class for all classes to be instantiated on the heap.
CGraphicsDevice
- Specifies the interface for concrete device classes.
CBitmapDevice
- Defines an abstract interface for the capabilities and attributes of a bitmapped...
Defined in CBitmapDevice
:
AddFile(const TDesC &,TInt &)
Adds a font file to the device's typeface store. The specified font file must be...CreateBitmapContext(CBitmapContext *&)
Creates a bitmap context for this bitmap device.FontHeightInPixels(TInt,TInt)const
Gets the height, in pixels, of the specified typeface at one of its defined heig...GetNearestFontInPixels(CFont *&,const TFontSpec &)
Gets the font which is the nearest to the given font specification.GetNearestFontToDesignHeightInPixels(CFont *&,const TFontSpec &)
Gets the font which is the nearest to the given font specification.GetNearestFontToMaxHeightInPixels(CFont *&,const TFontSpec &,TInt)
Gets the font which is the nearest to the given font specification.GetPixel(TRgb &,const TPoint &)const
Gets the RGB colour of an individual pixel on a bitmapped graphics device.GetScanLine(TDes8 &,const TPoint &,TInt,TDisplayMode)const
Copies a scanline into a buffer.RemoveFile(TInt)
Removes a font file from the font store.Inherited from CBase
:
Delete(CBase *)
Deletes the specified object.Extension_(TUint,TAny *&,TAny *)
Extension function operator new(TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TAny *)
Initialises the object to binary zeroes.operator new(TUint,TLeave)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TLeave,TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TUint)
Allocates the object from the heap and then initialises its contents to binary z...Inherited from CGraphicsDevice
:
CreateContext(CGraphicsContext *&)
Creates a graphics context for the device.DisplayMode()const
Gets the display mode of the device.FontHeightInTwips(TInt,TInt)const
Get the height of a font in twips.GetPalette(CPalette *&)const
Gets the device's current palette.NumTypefaces()const
Gets the number of typefaces supported by the graphics device.PaletteAttributes(TBool &,TInt &)const
Gets the palette attributes of the device.SetPalette(CPalette *)
Sets the device's palette.SizeInPixels()const
Gets the size of the device area in pixels.SizeInTwips()const
Gets the size of the device area in twips.TypefaceSupport(TTypefaceSupport &,TInt)const
Gets typeface information for a specified typeface.Inherited from MGraphicsDeviceMap
:
GetNearestFontInTwips(CFont *&,const TFontSpec &)
Gets the font which is the nearest to the given font specification.GetNearestFontToDesignHeightInTwips(CFont *&,const TFontSpec &)
Gets the font which is the nearest to the given font specification.GetNearestFontToMaxHeightInTwips(CFont *&,const TFontSpec &,TInt)
Gets the font which is the nearest to the given font specification.HorizontalPixelsToTwips(TInt)const
Converts a horizontal dimension from pixels to twips.HorizontalTwipsToPixels(TInt)const
Converts a horizontal dimension from twips to pixels.PixelsToTwips(const TPoint &)const
Converts a point in pixels to a point in twips.PixelsToTwips(const TRect &)const
Converts a rectangle in pixels to a rectangle in twips.ReleaseFont(CFont *)
Releases the specified font.TwipsToPixels(const TPoint &)const
Converts a point in twips to a point in pixels.TwipsToPixels(const TRect &)const
Converts a rectangle in twips to a rectangle in pixels.VerticalPixelsToTwips(TInt)const
Converts a vertical dimension from pixels to twips.VerticalTwipsToPixels(TInt)const
Converts a vertical dimension from twips to pixels.virtual void GetPixel(TRgb &aColor, const TPoint &aPixel) const=0;
Gets the RGB colour of an individual pixel on a bitmapped graphics device.
This pure virtual function is implemented in derived classes.
|
virtual void GetScanLine(TDes8 &aBuf, const TPoint &aStartPixel, TInt aLength, TDisplayMode aDispMode) const=0;
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.
|
virtual TInt AddFile(const TDesC &aName, TInt &aId)=0;
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.
|
|
virtual void RemoveFile(TInt aId=0)=0;
Removes a font file from the font store.
This pure virtual function is implemented in derived classes.
|
Interface status: | deprecated | Use GetNearestFontToDesignHeightInPixels |
virtual TInt GetNearestFontInPixels(CFont *&aFont, const TFontSpec &aFontSpec)=0;
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 GetNearestFontToDesignHeightInPixels()
yielding (virtually) the same result. However clients are strongly encouraged to use the new GetNearestFontToMaxHeightInPixels()
function instead. This will guarantee that every character within any given text string will fit within the given amount
of pixels, whereas the design height is an aesthetic unit decided by the font designer without strict physical meaning, which
may result in cropped characters.
|
|
inline virtual TInt GetNearestFontToDesignHeightInPixels(CFont *&, const TFontSpec &);
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 GetNearestFontInPixels()
yielding (virtually) the same result. However clients are strongly encouraged to use the new GetNearestFontToMaxHeightInPixels()
function instead. This will guarantee that every character within any given text string will fit within the given amount
of pixels, whereas the design height is an aesthetic unit decided by the font designer without strict physical meaning, which
may result in cropped characters.
|
|
inline virtual TInt GetNearestFontToMaxHeightInPixels(CFont *&, const TFontSpec &, TInt);
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.
|
|
virtual TInt FontHeightInPixels(TInt aTypefaceIndex, TInt aHeightIndex) const=0;
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.
|
|
TTypefaceSupport
Typeface family support information.CGraphicsDevice::NumTypefaces()const
Gets the number of typefaces supported by the graphics device.CGraphicsDevice::TypefaceSupport(TTypefaceSupport &,TInt)const
Gets typeface information for a specified typeface.inline TInt CreateBitmapContext(CBitmapContext *&aGC);
Creates a bitmap context for this bitmap device.
|
|