Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <BITSTD.H>

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:

Inherited from CBase:

Inherited from CGraphicsContext:


Construction and destruction


NewL()

IMPORT_C static CFbsBitGc* NewL();

Description

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

Return value

CFbsBitGc *

A pointer to the newly created object.


~CFbsBitGc()

IMPORT_C virtual ~CFbsBitGc();

Description

Frees all resources owned by the object.

[Top]


Member functions


Activate(CFbsDevice *)

IMPORT_C void Activate(CFbsDevice *aDevice);

Description

Sets the object to draw to a particular device

Parameters

CFbsDevice *aDevice

The target device.


ActivateNoJustAutoUpdate(CFbsDevice *)

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 CFbsBitGc::Activate(CFbsDevice *).

Parameters

CFbsDevice *aDevice

The target device.


BitBlt(const TPoint &,const CFbsBitGc &)

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(const TPoint &,const CFbsBitGc &,const TRect &)

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(const TPoint &,const CFbsBitmap *)

IMPORT_C virtual 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(const TPoint &,const CFbsBitmap *,const TRect &)

IMPORT_C virtual 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(const TPoint &,const CFbsBitmap *,const TRect &,const CFbsBitmap *,TBool)

IMPORT_C virtual 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(const TPoint &,const CFbsBitmap *,const TRect &,const CFbsBitmap *,TBool). The function behaviour is the same as documented in that class.

There are several points to note about this implementation of CFbsBitGc::BitBltMasked(const TPoint &,const CFbsBitmap *,const TRect &,const CFbsBitmap *,TBool):

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

3.Alpha blending is used when the display mode of the mask bitmap 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()

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

IMPORT_C virtual void CancelClippingRegion();

Description

Cancels the clipping region.


Clear()

IMPORT_C virtual 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(const TRect &)

IMPORT_C virtual 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 &). The function behaviour is the same as documented in that class.

Parameters

const TRect &aRect


CopyRect(const TPoint &,const TRect &)

IMPORT_C virtual 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(const CFbsBitGc &)

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

IMPORT_C virtual 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()const. The function behaviour is the same as documented in that class.

Return value

CGraphicsDevice *

See also:


DiscardBrushPattern()

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

IMPORT_C virtual 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(const TRect &,const TPoint &,const TPoint &)

IMPORT_C virtual 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(const TRect &,const TPoint &,const TPoint &)

IMPORT_C virtual 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(const TPoint &,const CFbsBitmap *)

IMPORT_C virtual 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(const TRect &,const CFbsBitmap *)

IMPORT_C virtual 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(const TPoint &,const CFbsBitmap *) instead. If the bitmap has to be scaled, consider creating another bitmap along with an CFbsBitmapDevice etc., doing CFbsBitGc::DrawBitmap(const TPoint &,const CFbsBitmap *) once and using CFbsBitGc::BitBlt(const TPoint &,const CFbsBitGc &) 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(const TRect &,const CFbsBitmap *,const TRect &)

IMPORT_C virtual 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(const TPoint &,const CFbsBitmap *) instead. If the bitmap has to be scaled, consider creating another bitmap along with an CFbsBitmapDevice etc., doing CFbsBitGc::DrawBitmap(const TPoint &,const CFbsBitmap *) once and using CFbsBitGc::BitBlt(const TPoint &,const CFbsBitGc &) 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(const TRect &,const CFbsBitmap *,const TRect &,const CFbsBitmap *,TBool)

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

aSourceRect should be in the bounds of the bitmap

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(const TPoint &,const CFbsBitmap *,const CFbsBitmap *,const TRect &,const TPoint &,const CFbsBitmap *,const TPoint &) 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(const TRect &,const CWsBitmap *,const TRect &,const CWsBitmap *,TBool)

IMPORT_C virtual 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(const TPoint &,const CFbsBitmap *,const CFbsBitmap *,const TRect &,const TPoint &,const CFbsBitmap *,const TPoint &) 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(const TRect &,const TSize &)

IMPORT_C virtual 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(const CArrayFix< TPoint > *)

IMPORT_C virtual 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(const CArrayFix< TPoint > *). The function behaviour is the same as documented in that class.

Parameters

const CArrayFix< TPoint > *aPointList


DrawPolyLineNoEndPoint(const CArrayFix< TPoint > *)

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(const TPoint *,TInt)

IMPORT_C virtual 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(const CArrayFix< TPoint > *). The function behaviour is the same as documented in that class.

Parameters

const TPoint *aPointList

TInt aNumPoints


DrawPolyLineNoEndPoint(const TPoint *,TInt)

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(const CArrayFix< TPoint > *,CGraphicsContext::TFillRule)

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(const CArrayFix< TPoint > *,TFillRule). The function behaviour is the same as documented in that class.

Parameters

const CArrayFix< TPoint > *aPointList

CGraphicsContext::TFillRule aFillRule

Return value

TInt


DrawPolygon(const TPoint *,TInt,CGraphicsContext::TFillRule)

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(const CArrayFix< TPoint > *,TFillRule). The function behaviour is the same as documented in that class.

Parameters

const TPoint *aPointList

TInt aNumPoints

CGraphicsContext::TFillRule aFillRule

Return value

TInt


DrawEllipse(const TRect &)

IMPORT_C virtual 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(const TPoint &,const TPoint &)

IMPORT_C virtual 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(const TPoint &,const TPoint &). The function behaviour is the same as documented in that class.

Parameters

const TPoint &aStart

const TPoint &aEnd


DrawLineTo(const TPoint &)

IMPORT_C virtual 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(const TPoint &). The function behaviour is the same as documented in that class.

Parameters

const TPoint &aPoint


DrawLineBy(const TPoint &)

IMPORT_C virtual 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(const TPoint &). The function behaviour is the same as documented in that class.

Parameters

const TPoint &aVector


DrawRect(const TRect &)

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

IMPORT_C void DrawText(const TDesC &aText);

Description

Draws text at the last print position.

Parameters

const TDesC16 &aText

The text string to be drawn.


DrawText(const TDesC &,const TPoint &)

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

Description

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

Parameters

const TDesC16 &aText

The text string to be drawn

const TPoint &aPosition

Coordinates to draw the text at.


DrawText(const TDesC &,const TRect &)

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

Description

Draws text clipped to the specified rectangle.

Parameters

const TDesC16 &aText

The text string to be drawn

const TRect &aBox

The clipping rectangle.


DrawText(const TDesC &,const TRect &,TInt,TTextAlign,TInt)

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

CGraphicsContext::TTextAlign aHrz

Horizontal alignment option relative to the specified rectangle.

TInt aMargin

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


DrawText(const TDesC &,const TRect &,TInt,TInt,TTextAlign,TInt)

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 TDesC16 &aText

The text string to be drawn

const TRect &aBox

The clipping rectangle.

TInt aBaselineOffset

TInt aTextWidth

CGraphicsContext::TTextAlign aHrz

TInt aMargin


DrawTextVertical(const TDesC &,TBool)

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 TDesC16 &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(const TDesC &,const TPoint &,TBool)

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

Description

Draws text vertically from the specified position.

Parameters

const TDesC16 &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(const TDesC &,const TRect &,TBool)

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 TDesC16 &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(const TDesC &,const TRect &,TInt,TBool,TTextAlign,TInt)

IMPORT_C virtual 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 TDesC16 &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.

CGraphicsContext::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(const TDesC &,const TRect &,TInt,TInt,TBool,TTextAlign,TInt)

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 TDesC16 &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.

CGraphicsContext::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(const TRect &,const TRgb *,TInt,TBool)

IMPORT_C virtual 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(const TPoint &)

IMPORT_C virtual void MoveTo(const TPoint &aPoint);

Description

Sets the internal drawing position relative to the co-ordinate origin. A subsequent call to CFbsBitGc::DrawLineTo(const TPoint &) or CFbsBitGc::DrawLineBy(const TPoint &) 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(const TPoint &). The function behaviour is the same as documented in that class.

Parameters

const TPoint &aPoint


MoveBy(const TPoint &)

IMPORT_C virtual 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(const TPoint &). The function behaviour is the same as documented in that class.

Parameters

const TPoint &aVector


OrientationsAvailable(TBool)

IMPORT_C void OrientationsAvailable(TBool aOrientation[4]);

Description

Gets the orientations supported.

Parameters

TBool aOrientation


Plot(const TPoint &)

IMPORT_C virtual 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(const TPoint &). The function behaviour is the same as documented in that class.

Parameters

const TPoint &aPoint


RectDrawnTo(TRect &)

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

IMPORT_C virtual 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(const TRgb &)

IMPORT_C virtual void SetBrushColor(const TRgb &aColor);

Description

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

Parameters

const TRgb &aColor


SetBrushOrigin(const TPoint &)

IMPORT_C virtual void SetBrushOrigin(const TPoint &aOrigin);

Description

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

Parameters

const TPoint &aOrigin


SetBrushStyle(TBrushStyle)

IMPORT_C virtual void SetBrushStyle(TBrushStyle aBrushStyle);

Description

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

Parameters

CGraphicsContext::TBrushStyle aBrushStyle


SetClippingRegion(const TRegion *)

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(const TRect &)

IMPORT_C virtual 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(const TRect &). The function behaviour is the same as documented in that class.

Parameters

const TRect &aRect


SetDitherOrigin(const TPoint &)

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

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(TDrawMode). The function behaviour is the same as documented in that class.

Parameters

CGraphicsContext::TDrawMode

See also:


SetOrigin(const TPoint &)

IMPORT_C virtual 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(const TPoint &). The function behaviour is the same as documented in that class.

Parameters

const TPoint &aPoint


SetPenColor(const TRgb &)

IMPORT_C virtual void SetPenColor(const TRgb &aColor);

Description

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

Parameters

const TRgb &aColor


SetPenStyle(TPenStyle)

IMPORT_C virtual 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(TPenStyle). The function behaviour is the same as documented in that class.

Parameters

CGraphicsContext::TPenStyle

See also:


SetPenSize(const TSize &)

IMPORT_C virtual 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(const TSize &). The function behaviour is the same as documented in that class.

Parameters

const TSize &aSize


SetCharJustification(TInt,TInt)

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

Description

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

Parameters

TInt aExcessWidth

TInt aNumGaps


SetWordJustification(TInt,TInt)

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

Description

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

Parameters

TInt aExcessWidth

TInt aNumChars


SetUnderlineStyle(TFontUnderline)

IMPORT_C virtual 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(TFontUnderline). The function behaviour is the same as documented in that class.

Parameters

TFontUnderline aUnderlineStyle


SetUserDisplayMode(TDisplayMode)

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

IMPORT_C virtual 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(TFontStrikethrough). The function behaviour is the same as documented in that class.

Parameters

TFontStrikethrough aStrikethroughStyle


SetShadowMode(TBool)

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

inline void SetFadeMode(TBool aFadeMode=EFalse);

Description

Parameters

TBool aFadeMode


SetFadingParameters(TUint8)

inline void SetFadingParameters(TUint8 aBlackMap=0);

Description

Parameters

TUint8 aBlackMap


SetFaded(TBool)

IMPORT_C virtual 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(TBool). The function behaviour is the same as documented in that class.

Parameters

TBool aFaded


SetFadingParameters(TUint8,TUint8)

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

Description

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

Parameters

TUint8 aBlackMap

TUint8 aWhiteMap


SetOrientation(TGraphicsOrientation)

IMPORT_C TBool SetOrientation(TGraphicsOrientation aOrientation);

Description

Sets the orientation.

Parameters

CFbsBitGc::TGraphicsOrientation aOrientation

The required orientation

Return value

TBool

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


ShadowArea(const TRegion *)

IMPORT_C void ShadowArea(const TRegion *aRegion);

Description

Sets the shadow area.

Parameters

const TRegion *aRegion

The region defining the shadow area.


FadeArea(const TRegion *)

IMPORT_C void FadeArea(const TRegion *aRegion);

Description

Sets the fade area.

Parameters

const TRegion *aRegion

The region defining the fade area.


UpdateJustification(const TDesC &)

IMPORT_C void UpdateJustification(const TDesC &aText);

Description

Updates the justification settings. This function assumes that CFbsBitGc::ActivateNoJustAutoUpdate(CFbsDevice *) has been used.

Parameters

const TDesC16 &aText

The text for which justification is to be adjusted.


UpdateJustificationVertical(const TDesC &,TBool)

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

Description

Updates the justification for vertical text.

Parameters

const TDesC16 &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(const CFbsBitmap *)

IMPORT_C virtual void UseBrushPattern(const CFbsBitmap *aBitmap);

Description

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

Parameters

const CFbsBitmap *aBitmap

The bitmap.


UseBrushPattern(TInt)

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(const CFont *)

IMPORT_C virtual 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 CFbsBitGc::DiscardFont() to free up the memory used. If CFbsBitGc::UseFont(const CFont *) is used again without using CFbsBitGc::DiscardFont() then the previous font is discarded automatically. If no font has been selected, and an attempt is made to draw text with CFbsBitGc::DrawText(const TDesC &), then a panic occurs.

Parameters

const CFont *aFont

See also:


UseFont(TInt)

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 CFbsBitGc::DiscardFont() to free up the memory used. If CFbsBitGc::UseFont(const CFont *) is used again without using CFbsBitGc::DiscardFont() then the previous font is discarded automatically.If no font has been selected, and an attempt is made to draw text with CFbsBitGc::DrawText(const TDesC &), then a panic occurs.

Parameters

TInt aFontHandle

A handle for a device font.

Return value

TInt

The result of CFbsFont::Duplicate(TInt).


UseFontNoDuplicate(const CFbsBitGcFont *)

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 CFbsBitGc::UseFont(const CFont *), CFbsBitGc::UseFontNoDuplicate(const CFbsBitGcFont *), CFbsBitGc::DiscardFont() or the destructor is called.

Parameters

const CFbsBitGcFont *aFont

A pointer to the font to be used.


IsBrushPatternUsed()const

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

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(const TUint8 *)

static inline TInt16 Load16(const TUint8 *aPtr);

Description

Parameters

const TUint8 *aPtr

Return value

TInt16


AlphaBlendBitmaps(const TPoint &,const CFbsBitmap *,const CFbsBitmap *,const TRect &,const TPoint &,const CFbsBitmap *,const TPoint &)

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(const TPoint &,const CFbsBitmap *,const TRect &,const CFbsBitmap *,const TPoint &)

IMPORT_C virtual 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(const TRegion &)

IMPORT_C virtual 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(const TPoint &,const CWsBitmap *,const TRect &,const CWsBitmap *,const TPoint &)

IMPORT_C virtual 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

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


APIExtension(TUid,TAny *&,TAny *)

protected: IMPORT_C virtual 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: IMPORT_C virtual void Reserved_CGraphicsContext_2();

Description

A reserved virtual function for future use.


Reserved_CBitmapContext_1()

private: IMPORT_C virtual void Reserved_CBitmapContext_1();

Description


Reserved_CBitmapContext_2()

private: IMPORT_C virtual void Reserved_CBitmapContext_2();

Description


Reserved_CBitmapContext_3()

private: IMPORT_C virtual void Reserved_CBitmapContext_3();

Description


Reserved_CFbsBitGc_1()

private: IMPORT_C virtual void Reserved_CFbsBitGc_1();

Description


Reserved_CFbsBitGc_2()

private: IMPORT_C virtual void Reserved_CFbsBitGc_2();

Description


Reserved_CFbsBitGc_3()

private: IMPORT_C virtual void Reserved_CFbsBitGc_3();

Description


Reserved_CFbsBitGc_4()

private: IMPORT_C virtual void Reserved_CFbsBitGc_4();

Description


Reserved_CFbsBitGc_5()

private: IMPORT_C virtual 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.