Symbian
Symbian OS Library

SYMBIAN OS V9.3

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



Location: BITSTD.H
Link against: bitgdi.lib

Class CFbsBitGc

class CFbsBitGc : public CBitmapContext;

Description

Concrete implementation of a bitmapped graphics context.

The class provides new functionality, and implementations of the pure virtual functions defined in CGraphicsContext and CBitmapContext.

Derivation

Members

Defined in CFbsBitGc:
APIExtension(), Activate(), ActivateNoJustAutoUpdate(), AlphaBlendBitmaps(), AlphaBlendBitmaps(), AlphaBlendBitmaps(), BitBlt(), BitBlt(), BitBlt(), BitBlt(), BitBltMasked(), CancelClipping(), CancelClippingRect(), CancelClippingRegion(), Clear(), Clear(), CopyRect(), CopySettings(), Device(), DiscardBrushPattern(), DiscardFont(), DrawArc(), DrawBitmap(), DrawBitmap(), DrawBitmap(), DrawBitmapMasked(), DrawBitmapMasked(), DrawEllipse(), DrawLine(), DrawLineBy(), DrawLineTo(), DrawPie(), DrawPolyLine(), DrawPolyLine(), DrawPolyLineNoEndPoint(), DrawPolyLineNoEndPoint(), DrawPolygon(), DrawPolygon(), DrawRect(), DrawRoundRect(), DrawText(), DrawText(), DrawText(), DrawText(), DrawText(), DrawTextVertical(), DrawTextVertical(), DrawTextVertical(), DrawTextVertical(), DrawTextVertical(), EGraphicsOrientationNormal, EGraphicsOrientationRotated180, EGraphicsOrientationRotated270, EGraphicsOrientationRotated90, FadeArea(), IsBrushPatternUsed(), IsFontUsed(), Load16(), MapColors(), MoveBy(), MoveTo(), NewL(), OrientationsAvailable(), Plot(), RectDrawnTo(), Reserved_CBitmapContext_1(), Reserved_CBitmapContext_2(), Reserved_CBitmapContext_3(), Reserved_CFbsBitGc_1(), Reserved_CFbsBitGc_2(), Reserved_CFbsBitGc_3(), Reserved_CFbsBitGc_4(), Reserved_CFbsBitGc_5(), Reserved_CGraphicsContext_2(), Reset(), Resized(), SetBrushColor(), SetBrushOrigin(), SetBrushStyle(), SetCharJustification(), SetClippingRect(), SetClippingRegion(), SetClippingRegion(), SetDitherOrigin(), SetDrawMode(), SetFadeMode(), SetFaded(), SetFadingParameters(), SetFadingParameters(), SetOrientation(), SetOrigin(), SetPenColor(), SetPenSize(), SetPenStyle(), SetShadowMode(), SetStrikethroughStyle(), SetUnderlineStyle(), SetUserDisplayMode(), SetWordJustification(), ShadowArea(), TGraphicsOrientation, UpdateJustification(), UpdateJustificationVertical(), UseBrushPattern(), UseBrushPattern(), UseFont(), UseFont(), UseFontNoDuplicate(), ~CFbsBitGc()

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

Inherited from CGraphicsContext:
DrawTextExtended(), EAlternate, EAnd, ECenter, EDashedPen, EDiamondCrossHatchBrush, EDotDashPen, EDotDotDashPen, EDottedPen, EDrawModeAND, EDrawModeANDNOT, EDrawModeNOTAND, EDrawModeNOTANDNOT, EDrawModeNOTOR, EDrawModeNOTORNOT, EDrawModeNOTPEN, EDrawModeNOTSCREEN, EDrawModeNOTXOR, EDrawModeOR, EDrawModeORNOT, EDrawModePEN, EDrawModeWriteAlpha, EDrawModeXOR, EForwardDiagonalHatchBrush, EHorizontalHatchBrush, EInvertPen, EInvertScreen, ELeft, ELogicalOp, ENullBrush, ENullPen, EOr, EPatternedBrush, EPenmode, ERearwardDiagonalHatchBrush, ERight, ESolidBrush, ESolidPen, ESquareCrossHatchBrush, EVerticalHatchBrush, EWinding, EWriteAlpha, EXor, GetUnderlineMetrics(), JustificationInPixels(), Reserved(), TBrushStyle, TDrawMode, TDrawModeComponents, TDrawTextExtendedParam, TDrawTextParam, TFillRule, TPenStyle, TTextAlign


Construction and destruction


NewL()

static IMPORT_C CFbsBitGc *NewL();

Description

Factory function for creating a CFbsBitGc object The object is then ready for a call to Activate().

Return value

CFbsBitGc *

A pointer to the newly created object.


~CFbsBitGc()

virtual IMPORT_C ~CFbsBitGc();

Description

Frees all resources owned by the object.

[Top]


Member functions


Activate()

IMPORT_C void Activate(CFbsDevice *aDevice);

Description

Sets the object to draw to a particular device

Parameters

CFbsDevice *aDevice

The target device.


ActivateNoJustAutoUpdate()

IMPORT_C void ActivateNoJustAutoUpdate(CFbsDevice *aDevice);

Description

Sets the object to draw to a particular device but doesn't 'use up' justification settings when drawing text. This is similar to Activate().

Parameters

CFbsDevice *aDevice

The target device.


BitBlt()

IMPORT_C void BitBlt(const TPoint &aPoint, const CFbsBitGc &aGc);

Description

Draws from another CFbsBitGc.

Parameters

const TPoint &aPoint

The position to draw the top left corner of the piece of bitmap

const CFbsBitGc &aGc

The source bitmap graphics context


BitBlt()

IMPORT_C void BitBlt(const TPoint &aPoint, const CFbsBitGc &aGc, const TRect &aSourceRect);

Description

Draws a particular rectangle from another CFbsBitGc.

Parameters

const TPoint &aPoint

The position to draw the top left corner of the piece of bitmap.

const CFbsBitGc &aGc

The source bitmap graphics context.

const TRect &aSourceRect

A rectangle defining the piece of the source to be drawn.


BitBlt()

virtual IMPORT_C void BitBlt(const TPoint &aPoint, const CFbsBitmap *aBitmap);

Description

Draws the whole of a CFbsBitmap.

Parameters

const TPoint &aPoint

The position to draw the top left corner of the bitmap.

const CFbsBitmap *aBitmap

The source bitmap.


BitBlt()

virtual IMPORT_C void BitBlt(const TPoint &aPoint, const CFbsBitmap *aBitmap, const TRect &aSourceRect);

Description

Draws a particular rectangle from a CFbsBitmap.

Parameters

const TPoint &aPoint

The position to draw the top left corner of the bitmap.

const CFbsBitmap *aBitmap

The source bitmap.

const TRect &aSourceRect

A rectangle defining the piece of the source to be drawn.


BitBltMasked()

virtual IMPORT_C void BitBltMasked(const TPoint &aPoint, const CFbsBitmap *aBitmap, const TRect &aSourceRect, const CFbsBitmap *aMaskBitmap, TBool aInvertMask);

Description

Performs a masked bitmap block transfer.

The function provides a concrete implementation of the pure virtual function CBitmapContext::BitBltMasked(). The function behaviour is the same as documented in that class.

There are several points to note about this implementation of BitBltMasked():

1.For best performance the aMaskBitmap and source aBitmap should have the same display mode as the destination device/bitmap.

2.For performance reasons this implementation does not validate the contents of the aMaskBitmap. The caller must ensure the mask pixels are either black or white otherwise undefined blitting causing unpredictable discoloration will result. This is especially true for index (where pixel is palette entry) display modes (e.g. EColor16). It is up to the caller to decide if they wish to utilise CFbsBitmap::IsMonochrome().

3.Alpha blending is used when the display mode of the aMaskBitmap is EGray256.

Parameters

const TPoint &aPoint

const CFbsBitmap *aBitmap

const TRect &aSourceRect

const CFbsBitmap *aMaskBitmap

TBool aInvertMask

See also:


CancelClipping()

IMPORT_C void CancelClipping();

Description

Cancels clipping rectangle and region.


CancelClippingRect()

virtual IMPORT_C void CancelClippingRect();

Description

Cancels any clipping rectangle. Clipping reverts to the full device area, the default. The function provides a concrete implementation of the pure virtual function CGraphicsContext::CancelClippingRect(). The function behaviour is the same as documented in that class.

See also:


CancelClippingRegion()

virtual IMPORT_C void CancelClippingRegion();

Description

Cancels the clipping region.


Clear()

virtual IMPORT_C void Clear();

Description

Clears the whole bitmap or a rectangular area of a bitmap.

The cleared area is filled with the current brush colour.

The function provides a concrete implementation of the pure virtual function CBitmapContext::Clear(). The function behaviour is the same as documented in that class.

See also:


Clear()

virtual IMPORT_C void Clear(const TRect &aRect);

Description

Clears a rectangular area.

The cleared area is filled with the current brush colour.The function provides a concrete implementation of the pure virtual function CBitmapContext::Clear(const TRect& aRect). The function behaviour is the same as documented in that class.

Parameters

const TRect &aRect


CopyRect()

virtual IMPORT_C void CopyRect(const TPoint &aOffset, const TRect &aRect);

Description

Copies a rectangle.

The function provides a concrete implementation of the pure virtual function CBitmapContext::CopyRect() . The function behaviour is the same as documented in that class.

Parameters

const TPoint &aOffset

const TRect &aRect


CopySettings()

IMPORT_C void CopySettings(const CFbsBitGc &aGc);

Description

Copies all settings from the specified bitmap graphics context.

Parameters

const CFbsBitGc &aGc

The bitmap graphics context whose settings are to be copied.


Device()

virtual IMPORT_C CGraphicsDevice *Device() const;

Description

Gets a pointer to the graphics device for the graphics context. The graphics device is the device currently being drawn to. The function provides a concrete implementation of the pure virtual function CGraphicsContext::Device(). The function behaviour is the same as documented in that class.

Return value

CGraphicsDevice *

See also:


DiscardBrushPattern()

virtual IMPORT_C void DiscardBrushPattern();

Description

Discards a non-built-in brush pattern. The function provides a concrete implementation of the pure virtual function CGraphicsContext::DiscardBrushPattern(). The function behaviour is the same as documented in that class.

See also:


DiscardFont()

virtual IMPORT_C void DiscardFont();

Description

Discards a selected device font. The function provides a concrete implementation of the pure virtual function CGraphicsContext::DiscardFont(). The function behaviour is the same as documented in that class.

See also:


DrawArc()

virtual IMPORT_C void DrawArc(const TRect &aRect, const TPoint &aStart, const TPoint &aEnd);

Description

Draws an arc.

The function provides a concrete implementation of the pure virtual function CGraphicsContext::DrawArc() . The function behaviour is the same as documented in that class.

Parameters

const TRect &aRect

const TPoint &aStart

const TPoint &aEnd


DrawPie()

virtual IMPORT_C void DrawPie(const TRect &aRect, const TPoint &aStart, const TPoint &aEnd);

Description

Draws and fills a pie slice.

The function provides a concrete implementation of the pure virtual function CGraphicsContext::DrawPie() . The function behaviour is the same as documented in that class.

Parameters

const TRect &aRect

const TPoint &aStart

const TPoint &aEnd


DrawBitmap()

virtual IMPORT_C void DrawBitmap(const TPoint &aTopLeft, const CFbsBitmap *aSource);

Description

Draws a bitmap.

The function has 3 overloads. The first draws the bitmap given the top left hand corner, doing a compress/stretch based on its internally stored size in twips. The second does a compress/stretch to fit a given rectangle. The third takes a rectangular section of the source bitmap and does a compress/stretch to fit a given destination rectangle.The functions provide a concrete implementation of the pure virtual function CGraphicsContext::DrawBitmap() . The function behaviour is the same as documented in that class.

Parameters

const TPoint &aTopLeft

const CFbsBitmap *aSource


DrawBitmap()

virtual IMPORT_C void DrawBitmap(const TRect &aDestRect, const CFbsBitmap *aSource);

Description

Draws a bitmap to fit a given rectangle.

The bitmap is compressed or stretched based on its internally stored size in pixels.

Notes:

This member function uses the bitmap's size in pixels and does a stretch/compress blit using a linear DDA.

As this function scales the bitmap, it is unavoidably slow. Therefore, where possible, use CBitmapContext::BitBlt() instead. If the bitmap has to be scaled, consider creating another bitmap along with an CFbsBitmapDevice etc., doing DrawBitmap() once and using BitBlt() subsequently.

Note that all bitmaps are clipped to the device boundaries.

Parameters

const TRect &aDestRect

The rectangle within which the bitmap is to be drawn.

const CFbsBitmap *aSource

A source bitmap.

See also:


DrawBitmap()

virtual IMPORT_C void DrawBitmap(const TRect &aDestRect, const CFbsBitmap *aSource, const TRect &aSourceRect);

Description

Draws a specified rectangle of a source bitmap to fit into a given destination rectangle.

Notes:

This member function uses rectangle sizes in pixels and does a stretch/compress blit using a linear DDA.

As this function scales the bitmap, it is unavoidably slow. Therefore, where possible, use CBitmapContext::BitBlt() instead. If the bitmap has to be scaled, consider creating another bitmap along with an CFbsBitmapDevice etc., doing DrawBitmap() once and using BitBlt() subsequently.

Note that all bitmaps are clipped to the device boundaries.

Parameters

const TRect &aDestRect

The rectangle within which the bitmap is to be drawn.

const CFbsBitmap *aSource

A source bitmap.

const TRect &aSourceRect

The rectangle in the source bitmap that is copied to the destination rectangle.

See also:


DrawBitmapMasked()

virtual IMPORT_C void DrawBitmapMasked(const TRect &aDestRect, const CFbsBitmap *aBitmap, const TRect &aSourceRect, const CFbsBitmap *aMaskBitmap, TBool aInvertMask);

Pre-Condition

aBitmap != NULL

aBitmap->Handle() != 0

aMaskBitmap != NULL

aMaskBitmap->Handle() != 0

!aSourceRect.IsEmpty()

Description

The method draws a specified rectangle from a bitmap and its mask into another rectangle and does a compress/stretch to fit a given destination rectangle.

Note: When using this function with a 256 Mask bitmap, it blends. Otherwise (e.g. with a 4bpp mask), this function masks rather than blends. If a user wants to blend the source into the destination they should use CFbsBitGc::AlphaBlendBitmaps() instead.

Parameters

const TRect &aDestRect

The rectangle within which the masked bitmap is to be drawn.

const CFbsBitmap *aBitmap

A pointer to the source bitmap.

const TRect &aSourceRect

The rectangle in the source bitmap that is copied to the destination rectangle.

const CFbsBitmap *aMaskBitmap

A pointer to the mask bitmap.

TBool aInvertMask

If false, a source pixel that is masked by a black pixel is not transferred to the destination rectangle. If true, then a source pixel that is masked by a white pixel is not transferred to the destination rectangle.


DrawBitmapMasked()

virtual IMPORT_C void DrawBitmapMasked(const TRect &aDestRect, const CWsBitmap *aBitmap, const TRect &aSourceRect, const CWsBitmap *aMaskBitmap, TBool aInvertMask);

Pre-Condition

aBitmap != NULL

aBitmap->Handle() != 0

aMaskBitmap != NULL

aMaskBitmap->Handle() != 0

!aSourceRect.IsEmpty()

Description

The method draws a specified rectangle from a bitmap and its mask into another rectangle and does a compress/stretch to fit a given destination rectangle.

This is an overload, which takes CWsBitmap* as argument, which in turn calls the other overload.

Note: A pointer to CWsBitmap must have the same pointer value as a pointer to the associated CFbsBitmap, otherwise code in BitGdi component will be Broken.

Note: When using this function with a 256 Mask bitmap, it blends. Otherwise (e.g. with a 4bpp mask), this function masks rather than blends. If a user wants to blend the source into the destination they should use CFbsBitGc::AlphaBlendBitmaps() instead.

Parameters

const TRect &aDestRect

The rectangle within which the masked bitmap is to be drawn.

const CWsBitmap *aBitmap

A pointer to the source bitmap.

const TRect &aSourceRect

The rectangle in the source bitmap that is copied to the destination rectangle.

const CWsBitmap *aMaskBitmap

A pointer to the mask bitmap.

TBool aInvertMask

If false, a source pixel that is masked by a black pixel is not transferred to the destination rectangle. If true, then a source pixel that is masked by a white pixel is not transferred to the destination rectangle.


DrawRoundRect()

virtual IMPORT_C void DrawRoundRect(const TRect &aRect, const TSize &aEllipse);

Description

Draws and fills a rectangle with rounded corners.

The function provides a concrete implementation of the pure virtual function CGraphicsContext::DrawRoundRect() . The function behaviour is the same as documented in that class.

Parameters

const TRect &aRect

const TSize &aEllipse


DrawPolyLine()

virtual IMPORT_C void DrawPolyLine(const CArrayFix< TPoint > *aPointList);

Description

Draws a polyline from a set of points specified in a list.

The functions provides a concrete implementation of the pure virtual functions CGraphicsContext::DrawPolyLine(). The function behaviour is the same as documented in that class.

Parameters

const CArrayFix< TPoint > *aPointList


DrawPolyLineNoEndPoint()

IMPORT_C void DrawPolyLineNoEndPoint(const CArrayFix< TPoint > *aPointList);

Description

Draws a polyline from a set of points specified in an array, but does not draw the final point of the last line.

Parameters

const CArrayFix< TPoint > *aPointList

An array containing the points on the polyline.


DrawPolyLine()

virtual IMPORT_C void DrawPolyLine(const TPoint *aPointList, TInt aNumPoints);

Description

Draws a polyline from a set of points specified in a list.

The functions provides a concrete implementation of the pure virtual functions CGraphicsContext::DrawPolyLine(). The function behaviour is the same as documented in that class.

Parameters

const TPoint *aPointList

TInt aNumPoints


DrawPolyLineNoEndPoint()

IMPORT_C void DrawPolyLineNoEndPoint(const TPoint *aPointList, TInt aNumPoints);

Description

Draws a polyline from a set of points specified in a list, but does not draw the final point of the last line.

Parameters

const TPoint *aPointList

Pointer to a set of points on the polyline.

TInt aNumPoints

Number of points in the list.


DrawPolygon()

IMPORT_C TInt DrawPolygon(const CArrayFix< TPoint > *aPointList, CGraphicsContext::TFillRule aFillRule=CGraphicsContext::EAlternate);

Description

Draws and fills a polygon defined using a list of points.

The function provides a concrete implementation of the pure virtual function CGraphicsContext::DrawPolygon(). The function behaviour is the same as documented in that class.

Parameters

const CArrayFix< TPoint > *aPointList

CGraphicsContext::TFillRule aFillRule

Return value

TInt


DrawPolygon()

IMPORT_C TInt DrawPolygon(const TPoint *aPointList, TInt aNumPoints, CGraphicsContext::TFillRule aFillRule=CGraphicsContext::EAlternate);

Description

Draws and fills a polygon defined using a list of points.

The function provides a concrete implementation of the pure virtual function CGraphicsContext::DrawPolygon(). The function behaviour is the same as documented in that class.

Parameters

const TPoint *aPointList

TInt aNumPoints

CGraphicsContext::TFillRule aFillRule

Return value

TInt


DrawEllipse()

virtual IMPORT_C void DrawEllipse(const TRect &aRect);

Description

Draws and fills an ellipse.

The function provides a concrete implementation of the pure virtual function CGraphicsContext::DrawEllipse() . The function behaviour is the same as documented in that class.

Parameters

const TRect &aRect


DrawLine()

virtual IMPORT_C void DrawLine(const TPoint &aStart, const TPoint &aEnd);

Description

Draws a straight line between two points.

The function provides a concrete implementation of the pure virtual function CGraphicsContext::DrawLine(). The function behaviour is the same as documented in that class.

Parameters

const TPoint &aStart

const TPoint &aEnd


DrawLineTo()

virtual IMPORT_C void DrawLineTo(const TPoint &aPoint);

Description

Draws a straight line from the current drawing point to a specified point.

The function provides a concrete implementation of the pure virtual function CGraphicsContext::DrawLineTo(). The function behaviour is the same as documented in that class.

Parameters

const TPoint &aPoint


DrawLineBy()

virtual IMPORT_C void DrawLineBy(const TPoint &aVector);

Description

Draws a straight line relative to the current drawing point, using a vector.

The function provides a concrete implementation of the pure virtual function CGraphicsContext::DrawLineBy(). The function behaviour is the same as documented in that class.

Parameters

const TPoint &aVector


DrawRect()

virtual IMPORT_C void DrawRect(const TRect &aRect);

Description

Draws and fills a rectangle.

The function provides a concrete implementation of the pure virtual function CGraphicsContext::DrawRect() . The function behaviour is the same as documented in that class.

Parameters

const TRect &aRect


DrawText()

IMPORT_C void DrawText(const TDesC &aText);

Description

Draws text at the last print position.

Parameters

const TDesC &aText

The text string to be drawn.


DrawText()

virtual IMPORT_C void DrawText(const TDesC &aText, const TPoint &aPosition);

Description

Draws text at the specified position and updates the print position.

Parameters

const TDesC &aText

The text string to be drawn

const TPoint &aPosition

Coordinates to draw the text at.


DrawText()

IMPORT_C void DrawText(const TDesC &aText, const TRect &aBox);

Description

Draws text clipped to the specified rectangle.

Parameters

const TDesC &aText

The text string to be drawn

const TRect &aBox

The clipping rectangle.


DrawText()

virtual IMPORT_C void DrawText(const TDesC &aText, const TRect &aBox, TInt aBaselineOffset, TTextAlign aHrz=ELeft, TInt aMargin=0);

Description

Draws text clipped to the specified rectangle using a baseline offset, horizontal alignment and a margin.

Parameters

const TDesC &aText

The text string to be drawn

const TRect &aBox

The clipping rectangle.

TInt aBaselineOffset

An offset in pixels for the baseline from the normal position (bottom of the rectangle minus the descent of the font).

TTextAlign aHrz

Horizontal alignment option relative to the specified rectangle.

TInt aMargin

Offset to add to the position as calculated using specified rectangle.


DrawText()

IMPORT_C void DrawText(const TDesC &aText, const TRect &aBox, TInt aBaselineOffset, TInt aTextWidth, TTextAlign aHrz=ELeft, TInt aMargin=0);

Description

Draws text clipped to the specified rectangle.

Parameters

const TDesC &aText

The text string to be drawn

const TRect &aBox

The clipping rectangle.

TInt aBaselineOffset

TInt aTextWidth

TTextAlign aHrz

TInt aMargin


DrawTextVertical()

IMPORT_C void DrawTextVertical(const TDesC &aText, TBool aUp);

Description

Draws text at the last print position and then rotates it into a vertical position.

Parameters

const TDesC &aText

The text string to be drawn.

TBool aUp

ETrue, text is rotated 90 degrees anti-clockwise; EFalse, text is rotated 90 degrees clockwise.


DrawTextVertical()

virtual IMPORT_C void DrawTextVertical(const TDesC &aText, const TPoint &aPosition, TBool aUp);

Description

Draws text vertically from the specified position.

Parameters

const TDesC &aText

The text string to be drawn.

const TPoint &aPosition

A point specifying the position of the left end of the text.

TBool aUp

ETrue, text is rotated 90 degrees anti-clockwise; EFalse, text is rotated 90 degrees clockwise.


DrawTextVertical()

IMPORT_C void DrawTextVertical(const TDesC &aText, const TRect &aBox, TBool aUp);

Description

Draws text clipped to the specified rectangle and then rotates it into a vertical position.

Parameters

const TDesC &aText

The text string to be drawn

const TRect &aBox

The clipping rectangle.

TBool aUp

ETrue, text is rotated 90 degrees anti-clockwise; EFalse, text is rotated 90 degrees clockwise.


DrawTextVertical()

virtual IMPORT_C void DrawTextVertical(const TDesC &aText, const TRect &aBox, TInt aBaselineOffset, TBool aUp, TTextAlign aVert=ELeft, TInt aMargin=0);

Description

Draws text vertically, clipped to a specified rectangle, using a baseline offset, alignment and margin.

Parameters

const TDesC &aText

The text string to be drawn.

const TRect &aBox

A rectangle to clip the text to.

TInt aBaselineOffset

Number of pixels to offset the baseline by.

TBool aUp

ETrue, text is rotated 90 degrees anti-clockwise; EFalse, text is rotated 90 degrees clockwise.

TTextAlign aVert

Verticaly alignment of the text relative to the specified rectangle.

TInt aMargin

Offset of the text from the position within the rectangle, using the specified alignment.


DrawTextVertical()

IMPORT_C void DrawTextVertical(const TDesC &aText, const TRect &aBox, TInt aBaselineOffset, TInt aTextWidth, TBool aUp, TTextAlign aVert=ELeft, TInt aMargin=0);

Description

Draws text vertically, clipped to a specified rectangle, using a baseline offset, alignment and margin.

Parameters

const TDesC &aText

The text string to be drawn.

const TRect &aBox

A rectangle to clip the text to.

TInt aBaselineOffset

Number of pixels to offset the baseline by.

TInt aTextWidth

Number of pixels to clip the text to.

TBool aUp

ETrue, text is rotated 90 degrees anti-clockwise; EFalse, text is rotated 90 degrees clockwise.

TTextAlign aVert

Verticaly alignment of the text relative to the specified rectangle.

TInt aMargin

Offset of the text from the position within the rectangle, using the specified alignment.


MapColors()

virtual IMPORT_C void MapColors(const TRect &aRect, const TRgb *aColors, TInt aNumPairs=2, TBool aMapForwards=ETrue);

Description

Maps pixels in the specified rectangle. The function tries to match the colour of a pixel with one of the RGB values in an array of RGB pairs. If there is a match, the colour is changed to the value specified in the other RGB in the RGB pair.

Parameters

const TRect &aRect

The rectangle in which pixels are to be mapped.

const TRgb *aColors

A pointer to a set of RGB pairs.

TInt aNumPairs

The number of pairs

TBool aMapForwards

ETrue, mapping is done from the first RGB to the second RGB in the pair; EFalse, mapping is done from the second RGB to the first RGB in the pair.


MoveTo()

virtual IMPORT_C void MoveTo(const TPoint &aPoint);

Description

Sets the internal drawing position relative to the co-ordinate origin. A subsequent call to DrawLineTo() or DrawLineBy() uses the new drawing point as the start point for the line drawn.The function provides a concrete implementation of the pure virtual function CGraphicsContext::MoveTo(). The function behaviour is the same as documented in that class.

Parameters

const TPoint &aPoint


MoveBy()

virtual IMPORT_C void MoveBy(const TPoint &aVector);

Description

Sets the drawing point relative to the current co-ordinates. The function provides a concrete implementation of the pure virtual function CGraphicsContext::MoveBy(). The function behaviour is the same as documented in that class.

Parameters

const TPoint &aVector


OrientationsAvailable()

IMPORT_C void OrientationsAvailable(TBool aOrientation[4]);

Description

Gets the orientations supported.

Parameters

TBool aOrientation


Plot()

virtual IMPORT_C void Plot(const TPoint &aPoint);

Description

Draws a single point.

The point is drawn with the current pen settings using the current drawing mode.The function provides a concrete implementation of the pure virtual function CGraphicsContext::Plot(). The function behaviour is the same as documented in that class.

Parameters

const TPoint &aPoint


RectDrawnTo()

IMPORT_C void RectDrawnTo(TRect &aRect);

Description

Sets the bounding rectangle of all drawing done since this function was last called.

Parameters

TRect &aRect

The bounding rectangle.


Reset()

virtual IMPORT_C void Reset();

Description

Resets the graphics context to its default settings. The function provides a concrete implementation of the pure virtual function CGraphicsContext::Reset(). The function behaviour is the same as documented in that class.

See also:


Resized()

IMPORT_C void Resized();

Description

Needs to be called if the device is resized. This only applies to devices of type CFbsBitmapDevice.


SetBrushColor()

virtual IMPORT_C void SetBrushColor(const TRgb &aColor);

Description

Sets the brush colour. The function provides a concrete implementation of the pure virtual function CGraphicsContext::SetBrushColor(). The function behaviour is the same as documented in that class.

Parameters

const TRgb &aColor


SetBrushOrigin()

virtual IMPORT_C void SetBrushOrigin(const TPoint &aOrigin);

Description

Sets the brush pattern origin. The function provides a concrete implementation of the pure virtual function CGraphicsContext::SetBrushOrigin(). The function behaviour is the same as documented in that class.

Parameters

const TPoint &aOrigin


SetBrushStyle()

virtual IMPORT_C void SetBrushStyle(TBrushStyle aBrushStyle);

Description

Sets the brush style. The function provides a concrete implementation of the pure virtual function CGraphicsContext::SetBrushStyle(). The function behaviour is the same as documented in that class.

Parameters

TBrushStyle aBrushStyle


SetClippingRegion()

IMPORT_C void SetClippingRegion(const TRegion *aRegion);

Description

Sets a clipping region by storing a pointer to the TRegion parameter.

Parameters

const TRegion *aRegion

The clipping region.


SetClippingRect()

virtual IMPORT_C void SetClippingRect(const TRect &aRect);

Description

Sets the clipping rectangle the area of visible drawing depends on the clipping region. The default clipping rectangle is the full device area.The function provides a concrete implementation of the pure virtual function CGraphicsContext::SetClippingRect(). The function behaviour is the same as documented in that class.

Parameters

const TRect &aRect


SetDitherOrigin()

IMPORT_C void SetDitherOrigin(const TPoint &aPoint);

Description

Sets the dither origin. This is only useful for modes that do dithering. If the display is scrolled an odd number of pixels then the (2x2) dither pattern will not match up for new drawing unless this is called.

Parameters

const TPoint &aPoint

The dither origin.


SetDrawMode()

IMPORT_C void SetDrawMode(TDrawMode);

Description

Sets the drawing mode. This affects the colour that is actually drawn, because it defines the way that the current screen colour logically combines with the current pen colour and brush colour. The function provides a concrete implementation of the pure virtual function CGraphicsContext::SetDrawMode(). The function behaviour is the same as documented in that class.

Parameters

TDrawMode

See also:


SetOrigin()

virtual IMPORT_C void SetOrigin(const TPoint &aPoint=TPoint(0, 0));

Description

Sets the position of the co-ordinate origin. All subsequent drawing operations are then done relative to this origin.The function provides a concrete implementation of the pure virtual function CGraphicsContext::SetOrigin(). The function behaviour is the same as documented in that class.

Parameters

const TPoint &aPoint


SetPenColor()

virtual IMPORT_C void SetPenColor(const TRgb &aColor);

Description

Sets the pen colour. The function provides a concrete implementation of the pure virtual function CGraphicsContext::SetPenColor(). The function behaviour is the same as documented in that class.

Parameters

const TRgb &aColor


SetPenStyle()

virtual IMPORT_C void SetPenStyle(TPenStyle);

Description

Sets the line drawing style for the pen. The function provides a concrete implementation of the pure virtual function CGraphicsContext::SetPenStyle(). The function behaviour is the same as documented in that class.

Parameters

TPenStyle

See also:


SetPenSize()

virtual IMPORT_C void SetPenSize(const TSize &aSize);

Description

Sets the line drawing size for the pen. The function provides a concrete implementation of the pure virtual function CGraphicsContext::SetPenSize(). The function behaviour is the same as documented in that class.

Parameters

const TSize &aSize


SetCharJustification()

virtual IMPORT_C void SetCharJustification(TInt aExcessWidth, TInt aNumGaps);

Description

Sets the character justification. The function provides a concrete implementation of the pure virtual function CGraphicsContext::SetCharJustification(). The function behaviour is the same as documented in that class.

Parameters

TInt aExcessWidth

TInt aNumGaps


SetWordJustification()

virtual IMPORT_C void SetWordJustification(TInt aExcessWidth, TInt aNumChars);

Description

Sets the word justification. The function provides a concrete implementation of the pure virtual function CGraphicsContext::SetWordJustification(). The function behaviour is the same as documented in that class.

Parameters

TInt aExcessWidth

TInt aNumChars


SetUnderlineStyle()

virtual IMPORT_C void SetUnderlineStyle(TFontUnderline aUnderlineStyle);

Description

Sets the underline style for all subsequently drawn text. The function provides a concrete implementation of the pure virtual function CGraphicsContext::SetUnderlineStyle(). The function behaviour is the same as documented in that class.

Parameters

TFontUnderline aUnderlineStyle


SetUserDisplayMode()

IMPORT_C void SetUserDisplayMode(TDisplayMode aDisplayMode);

Description

Simulates another graphics mode. Some devices running in some modes can simulate other modes (EGray16 will do EGray4 and EGray2, EGray4 will do EGray2).

Parameters

TDisplayMode aDisplayMode

The display mode to be set.


SetStrikethroughStyle()

virtual IMPORT_C void SetStrikethroughStyle(TFontStrikethrough aStrikethroughStyle);

Description

Sets the strikethrough style for all subsequently drawn text. The function provides a concrete implementation of the pure virtual function CGraphicsContext::SetStrikethroughStyle(). The function behaviour is the same as documented in that class.

Parameters

TFontStrikethrough aStrikethroughStyle


SetShadowMode()

IMPORT_C void SetShadowMode(TBool aShadowMode=EFalse);

Description

Sets the shadow mode on or off.

Parameters

TBool aShadowMode

ETrue, shadow mode is on; EFalse, shadow mode is off. EFalse is the default.


SetFadeMode()

inline void SetFadeMode(TBool aFadeMode=EFalse);

Description

Parameters

TBool aFadeMode


SetFadingParameters()

inline void SetFadingParameters(TUint8 aBlackMap=0);

Description

Parameters

TUint8 aBlackMap


SetFaded()

virtual IMPORT_C void SetFaded(TBool aFaded);

Description

Sets whether the graphics context is faded. The function provides a concrete implementation of the pure virtual function CBitmapContext::SetFaded(). The function behaviour is the same as documented in that class.

Parameters

TBool aFaded


SetFadingParameters()

virtual IMPORT_C void SetFadingParameters(TUint8 aBlackMap, TUint8 aWhiteMap);

Description

Set fading parameters. The function provides a concrete implementation of the pure virtual function CBitmapContext::SetFadingParameters(). The function behaviour is the same as documented in that class.

Parameters

TUint8 aBlackMap

TUint8 aWhiteMap


SetOrientation()

IMPORT_C TBool SetOrientation(TGraphicsOrientation aOrientation);

Description

Sets the orientation.

Parameters

TGraphicsOrientation aOrientation

The required orientation

Return value

TBool

ETrue, if the requested orientation is supported; EFalse, otherwise.


ShadowArea()

IMPORT_C void ShadowArea(const TRegion *aRegion);

Description

Sets the shadow area.

Parameters

const TRegion *aRegion

The region defining the shadow area.


FadeArea()

IMPORT_C void FadeArea(const TRegion *aRegion);

Description

Sets the fade area.

Parameters

const TRegion *aRegion

The region defining the fade area.


UpdateJustification()

IMPORT_C void UpdateJustification(const TDesC &aText);

Description

Updates the justification settings. This function assumes that ActivateNoJustAutoUpdate() has been used.

Parameters

const TDesC &aText

The text for which justification is to be adjusted.


UpdateJustificationVertical()

IMPORT_C void UpdateJustificationVertical(const TDesC &aText, TBool aUp);

Description

Updates the justification for vertical text.

Parameters

const TDesC &aText

The text for which justification is to be adjusted.

TBool aUp

ETrue, if text is to be justified upwards;EFalse, if text is to be justified downwards.


UseBrushPattern()

virtual IMPORT_C void UseBrushPattern(const CFbsBitmap *aBitmap);

Description

Sets the specified bitmap to be used as the brush pattern.

Parameters

const CFbsBitmap *aBitmap

The bitmap.


UseBrushPattern()

IMPORT_C TInt UseBrushPattern(TInt aFbsBitmapHandle);

Description

Sets the specified bitmap to be used as the brush pattern.

Parameters

TInt aFbsBitmapHandle

The handle number of the bitmap.

Return value

TInt

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


UseFont()

virtual IMPORT_C void UseFont(const CFont *aFont);

Description

Selects the device font, identified by handle number, to be used for text drawing. Notes: When the font is no longer required, use DiscardFont() to free up the memory used. If UseFont() is used again without using DiscardFont() then the previous font is discarded automatically. If no font has been selected, and an attempt is made to draw text with DrawText(), then a panic occurs.

Parameters

const CFont *aFont

See also:


UseFont()

IMPORT_C TInt UseFont(TInt aFontHandle);

Description

Selects the device font, identified by handle, to be used for text drawing. Notes:When the font is no longer required, use DiscardFont() to free up the memory used. If UseFont() is used again without using DiscardFont() then the previous font is discarded automatically.If no font has been selected, and an attempt is made to draw text with DrawText(), then a panic occurs.

Parameters

TInt aFontHandle

A handle for a device font.

Return value

TInt

The result of CFbsFont::Duplicate().


UseFontNoDuplicate()

IMPORT_C void UseFontNoDuplicate(const CFbsBitGcFont *aFont);

Description

Selects a device font for text drawing but does not take a copy. The original must not be destroyed until UseFont(), UseFontNoDuplicate(), DiscardFont() or the destructor is called.

Parameters

const CFbsBitGcFont *aFont

A pointer to the font to be used.


IsBrushPatternUsed()

IMPORT_C TBool IsBrushPatternUsed() const;

Description

Tests whether a brush pattern is being used.

Return value

TBool

ETrue, if a brush pattern is being used; EFalse, otherwise.


IsFontUsed()

IMPORT_C TBool IsFontUsed() const;

Description

Tests whether a font is used.

Return value

TBool

ETrue, if a font is being used; EFalse, otherwise.


Load16()

static inline TInt16 Load16(const TUint8 *aPtr);

Description

Parameters

const TUint8 *aPtr

Return value

TInt16


AlphaBlendBitmaps()

IMPORT_C TInt AlphaBlendBitmaps(const TPoint &aDestPt, const CFbsBitmap *aSrcBmp1, const CFbsBitmap *aSrcBmp2, const TRect &aSrcRect1, const TPoint &aSrcPt2, const CFbsBitmap *aAlphaBmp, const TPoint &aAlphaPt);

Description

The method performs an alpha blending of the source data - aSrcBmp1 and aSrcBmp2, using the data from aAlphaBmp as an alpha blending factor. The formula used for that, is: (C1 * A + C2 * (255 - A)) / 255, where:

Parameters

const TPoint &aDestPt

const CFbsBitmap *aSrcBmp1

const CFbsBitmap *aSrcBmp2

const TRect &aSrcRect1

const TPoint &aSrcPt2

const CFbsBitmap *aAlphaBmp

const TPoint &aAlphaPt

Return value

TInt


AlphaBlendBitmaps()

virtual IMPORT_C TInt AlphaBlendBitmaps(const TPoint &aDestPt, const CFbsBitmap *aSrcBmp, const TRect &aSrcRect, const CFbsBitmap *aAlphaBmp, const TPoint &aAlphaPt);

Description

The method performs an alpha blending of the source data - aSrcBmp - with the existing image, using the data from aAlphaBmp as an alpha blending factor. The formula used for that, is: (C * A + D * (255 - A)) / 255, where:

Parameters

const TPoint &aDestPt

const CFbsBitmap *aSrcBmp

const TRect &aSrcRect

const CFbsBitmap *aAlphaBmp

const TPoint &aAlphaPt

Return value

TInt


SetClippingRegion()

virtual IMPORT_C TInt SetClippingRegion(const TRegion &aRegion);

Description

Sets a clipping region by storing a copy of the TRegion parameter.

Parameters

const TRegion &aRegion

The clipping region to be stored and used. aRegion must be valid and bounded withing the iDefaultRegion.

Return value

TInt

KErrNone if successful; KErrArgument if aRegion is invalid, KErrMemory if the region could not be allocated.

See also:


AlphaBlendBitmaps()

virtual IMPORT_C TInt AlphaBlendBitmaps(const TPoint &aDestPt, const CWsBitmap *aSrcBmp, const TRect &aSrcRect, const CWsBitmap *aAlphaBmp, const TPoint &aAlphaPt);

Description

The method performs an alpha blending of the source data, aSrcBmp, with the CBitmapContext, using the data from aAlphaBmp as an alpha blending factor. For information on how this function works, see the other overload.

Parameters

const TPoint &aDestPt

Position in the target the result should be drawn to.

const CWsBitmap *aSrcBmp

A pointer to the source bitmap.

const TRect &aSrcRect

The part of the source bitmap that should be used.

const CWsBitmap *aAlphaBmp

A pointer to the bitmap used as an alpha blending factor.

const TPoint &aAlphaPt

Position of the first pixel in the alpha bitmap that should be used as a source for the alpha blending. The size of the area is the same as the source bitmap area - aSrcRect parameter.

Return value

TInt


APIExtension()

protected: virtual IMPORT_C TInt APIExtension(TUid aUid, TAny *&aOutput, TAny *aInput);

Description

This function should not be used by externals but must retain the same ordinal number to maintain BC, thus is exported.

Parameters

TUid aUid

TAny *&aOutput

TAny *aInput

Return value

TInt


Reserved_CGraphicsContext_2()

private: virtual IMPORT_C void Reserved_CGraphicsContext_2();

Description

A reserved virtual function for future use.


Reserved_CBitmapContext_1()

private: virtual IMPORT_C void Reserved_CBitmapContext_1();

Description


Reserved_CBitmapContext_2()

private: virtual IMPORT_C void Reserved_CBitmapContext_2();

Description


Reserved_CBitmapContext_3()

private: virtual IMPORT_C void Reserved_CBitmapContext_3();

Description


Reserved_CFbsBitGc_1()

private: virtual IMPORT_C void Reserved_CFbsBitGc_1();

Description


Reserved_CFbsBitGc_2()

private: virtual IMPORT_C void Reserved_CFbsBitGc_2();

Description


Reserved_CFbsBitGc_3()

private: virtual IMPORT_C void Reserved_CFbsBitGc_3();

Description


Reserved_CFbsBitGc_4()

private: virtual IMPORT_C void Reserved_CFbsBitGc_4();

Description


Reserved_CFbsBitGc_5()

private: virtual IMPORT_C void Reserved_CFbsBitGc_5();

Description

[Top]


Member enumerations


Enum TGraphicsOrientation

TGraphicsOrientation

Description

Defines possible rotation values.

EGraphicsOrientationNormal

Normal orientation is supported.

EGraphicsOrientationRotated90

A 90 degree rotation is supported.

EGraphicsOrientationRotated180

A 180 degree rotation is supported.

EGraphicsOrientationRotated270

A 270 degree rotation is supported.