CBitmapContext Class Reference

#include <gdi.h>

Link against: gdi.lib

class CBitmapContext : public CGraphicsContext

Inherits from

Public Member Functions
pure virtual TInt AlphaBlendBitmaps(const TPoint &, const CFbsBitmap *, const TRect &, const CFbsBitmap *, const TPoint &)
pure virtual TInt AlphaBlendBitmaps(const TPoint &, const CWsBitmap *, const TRect &, const CWsBitmap *, const TPoint &)
pure virtual voidBitBlt(const TPoint &, const CFbsBitmap *)
pure virtual voidBitBlt(const TPoint &, const CFbsBitmap *, const TRect &)
pure virtual voidBitBltMasked(const TPoint &, const CFbsBitmap *, const TRect &, const CFbsBitmap *, TBool)
pure virtual voidClear()
pure virtual voidClear(const TRect &)
pure virtual voidCopyRect(const TPoint &, const TRect &)
pure virtual voidSetFaded(TBool)
pure virtual voidSetFadingParameters(TUint8, TUint8)
Protected Member Functions
virtual IMPORT_C TIntAPIExtension(TUid, TAny *&, TAny *)
virtual IMPORT_C voidReserved_CBitmapContext_1()
virtual IMPORT_C voidReserved_CBitmapContext_2()
virtual IMPORT_C voidReserved_CBitmapContext_3()
virtual IMPORT_C voidReserved_CGraphicsContext_2()
Inherited Enumerations
CGraphicsContext:TBrushStyle
CGraphicsContext:TDrawMode
CGraphicsContext:TDrawModeComponents
CGraphicsContext:TFillRule
CGraphicsContext:TPenStyle
CGraphicsContext:TTextAlign
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CGraphicsContext::CancelClippingRect()
CGraphicsContext::CancelClippingRegion()
CGraphicsContext::Device()const
CGraphicsContext::DiscardBrushPattern()
CGraphicsContext::DiscardFont()
CGraphicsContext::DrawArc(const TRect &,const TPoint &,const TPoint &)
CGraphicsContext::DrawBitmap(const TPoint &,const CFbsBitmap *)
CGraphicsContext::DrawBitmap(const TRect &,const CFbsBitmap *)
CGraphicsContext::DrawBitmap(const TRect &,const CFbsBitmap *,const TRect &)
CGraphicsContext::DrawBitmapMasked(const TRect &,const CFbsBitmap *,const TRect &,const CFbsBitmap *,TBool)
CGraphicsContext::DrawBitmapMasked(const TRect &,const CWsBitmap *,const TRect &,const CWsBitmap *,TBool)
CGraphicsContext::DrawEllipse(const TRect &)
CGraphicsContext::DrawLine(const TPoint &,const TPoint &)
CGraphicsContext::DrawLineBy(const TPoint &)
CGraphicsContext::DrawLineTo(const TPoint &)
CGraphicsContext::DrawPie(const TRect &,const TPoint &,const TPoint &)
CGraphicsContext::DrawPolyLine(const CArrayFix< TPoint > *)
CGraphicsContext::DrawPolyLine(const TPoint *,TInt)
CGraphicsContext::DrawPolygon(const CArrayFix< TPoint > *,TFillRule)
CGraphicsContext::DrawPolygon(const TPoint *,TInt,TFillRule)
CGraphicsContext::DrawRect(const TRect &)
CGraphicsContext::DrawRoundRect(const TRect &,const TSize &)
CGraphicsContext::DrawText(const TDesC &,const TPoint &)
CGraphicsContext::DrawText(const TDesC &,const TPoint &,const TDrawTextParam &)
CGraphicsContext::DrawText(const TDesC &,const TRect &,TInt,TTextAlign,TInt)
CGraphicsContext::DrawText(const TDesC &,const TTextParameters *,const TPoint &)
CGraphicsContext::DrawText(const TDesC &,const TTextParameters *,const TPoint &,const TDrawTextParam &)
CGraphicsContext::DrawText(const TDesC &,const TTextParameters *,const TRect &,TInt,TTextAlign,TInt)
CGraphicsContext::DrawTextExtended(const TDesC &,const TPoint &,const TDrawTextExtendedParam &)
CGraphicsContext::DrawTextExtended(const TDesC &,const TTextParameters *,const TPoint &,const TDrawTextExtendedParam &)
CGraphicsContext::DrawTextVertical(const TDesC &,const TPoint &,TBool)
CGraphicsContext::DrawTextVertical(const TDesC &,const TRect &,TInt,TBool,TTextAlign,TInt)
CGraphicsContext::DrawTextVertical(const TDesC &,const TTextParameters *,const TPoint &,TBool)
CGraphicsContext::DrawTextVertical(const TDesC &,const TTextParameters *,const TRect &,TInt,TBool,TTextAlign,TInt)
CGraphicsContext::GetShadowColor(TRgb &)
CGraphicsContext::GetUnderlineMetrics(TInt &,TInt &)
CGraphicsContext::IsFbsBitGc()const
CGraphicsContext::JustificationInPixels(TInt &,TInt &)
CGraphicsContext::JustificationInPixels(TInt,TInt,TInt,TInt)
CGraphicsContext::MapColors(const TRect &,const TRgb *,TInt,TBool)
CGraphicsContext::MoveBy(const TPoint &)
CGraphicsContext::MoveTo(const TPoint &)
CGraphicsContext::Plot(const TPoint &)
CGraphicsContext::Reserved()
CGraphicsContext::Reset()
CGraphicsContext::SetBrushColor(const TRgb &)
CGraphicsContext::SetBrushOrigin(const TPoint &)
CGraphicsContext::SetBrushStyle(TBrushStyle)
CGraphicsContext::SetCharJustification(TInt,TInt)
CGraphicsContext::SetClippingRect(const TRect &)
CGraphicsContext::SetClippingRegion(const TRegion &)
CGraphicsContext::SetDrawMode(TDrawMode)
CGraphicsContext::SetOrigin(const TPoint &)
CGraphicsContext::SetPenColor(const TRgb &)
CGraphicsContext::SetPenSize(const TSize &)
CGraphicsContext::SetPenStyle(TPenStyle)
CGraphicsContext::SetShadowColor(const TRgb &)
CGraphicsContext::SetStrikethroughStyle(TFontStrikethrough)
CGraphicsContext::SetUnderlineStyle(TFontUnderline)
CGraphicsContext::SetWordJustification(TInt,TInt)
CGraphicsContext::UseBrushPattern(const CFbsBitmap *)
CGraphicsContext::UseFont(const CFont *)

Detailed Description

An abstract, device-independent, interface to bitmapped graphics contexts.

This holds the setting used to draw to a CBitmapDevice.

The default settings of a CBitmapContext object immediately after construction are:

drawing mode is EDrawModePen (pen and brush colours used as they are)

no clipping rectangle

pen settings are: black, solid, single pixel width

brush style is null

no text font selected

The classes CFbsBitGc and CWindowGc are derived from this class.

See also: CFbsBitGc

Member Function Documentation

APIExtension ( TUid, TAny *&, TAny * )

IMPORT_C TIntAPIExtension(TUidaUid,
TAny *&aOutput,
TAny *aInput
)[protected, virtual]

Reimplemented from CGraphicsContext::APIExtension(TUid,TAny *&,TAny *)

An APIExtension method to allow the addition of new APIs to retain compatibility with previous versions of gdi.dll

See also: CGraphicsContext WARNING: Function for internal use ONLY. Compatibility is not guaranteed in future releases.

An API extension for CGraphics context replacing a reserved virtual method. Effectively allows multiple methods to use just one ordinal number.

ParameterDescription
aOutputis for output
aInputis for input

Returns: KErrNone If a successful derived function is found, if the default is used then KErrNotSupported is returned.

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

TInt AlphaBlendBitmaps(const TPoint &aDestPt,
const CFbsBitmap *aSrcBmp,
const TRect &aSrcRect,
const CFbsBitmap *aAlphaBmp,
const TPoint &aAlphaPt
)[pure virtual]
Performs an alpha blending of the source data, aSrcBmp, with the CBitmapContext, using the data from aAlphaBmp as an alpha blending factor. The formula used is: (S * A + W * (255 - A)) / 255, where:
  • S - a pixel from aSrcBmp;

  • W - a pixel from the window;

  • A - a pixel from aAlphaBmp; The contents of source and alpha bitmap are preserved. The calculated alpha blended pixels are written to the destination CBitmapContext.

ParameterDescription
aDestPtPosition in the target the result should be drawn to.
aSrcBmpA pointer to the source bitmap.
aSrcRectThe part of the source bitmap that should be used.
aAlphaBmpA pointer to the bitmap used as an alpha blending factor.
aAlphaPtPosition 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.

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

TInt AlphaBlendBitmaps(const TPoint &aDestPt,
const CWsBitmap *aSrcBmp,
const TRect &aSrcRect,
const CWsBitmap *aAlphaBmp,
const TPoint &aAlphaPt
)[pure virtual]

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.

ParameterDescription
aDestPtPosition in the target the result should be drawn to.
aSrcBmpA pointer to the source bitmap.
aSrcRectThe part of the source bitmap that should be used.
aAlphaBmpA pointer to the bitmap used as an alpha blending factor.
aAlphaPtPosition 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.

BitBlt ( const TPoint &, const CFbsBitmap * )

voidBitBlt(const TPoint &aPoint,
const CFbsBitmap *aBitmap
)[pure virtual]

Performs a bitmap block transfer.

This pure virtual function is implemented in derived classes.

ParameterDescription
aPointThe destination for the top left corner of the transferred bitmap. It is relative to the top left corner of the destination bitmap, which may be the screen.
aBitmapA memory-resident bitmap.

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

voidBitBlt(const TPoint &aPoint,
const CFbsBitmap *aBitmap,
const TRect &aRect
)[pure virtual]

Performs a bitmap block transfer of a rectangular piece of a bitmap.

If the specified rectangle is larger than the bitmap then the bitmap is padded with white.

This pure virtual function is implemented in derived classes.

ParameterDescription
aPointThe destination for the top left corner of the transferred bitmap. It is relative to the top left corner of the destination bitmap, which may be the screen.
aBitmapA memory-resident bitmap
aRectA rectangle defining the portion of the bitmap to transfer. Its coordinates are relative to the top left corner of the source bitmap.

BitBltMasked ( const TPoint &, const CFbsBitmap *, const TRect &, const CFbsBitmap *, TBool )

voidBitBltMasked(const TPoint &aPoint,
const CFbsBitmap *aBitmap,
const TRect &aSourceRect,
const CFbsBitmap *aMaskBitmap,
TBoolaInvertMask
)[pure virtual]

Performs a masked bitmap block transfer.

The mask bitmap can be used as either a positive or negative mask. Masked pixels are not mapped to the destination rectangle.

This function uses either a black and white (binary) mask bitmap, or if aMaskBitmap's display mode is EGray256, alpha blending is used. Use of any other mode may result in unpredictable results

With aInvertMask=EFalse, black pixels in the mask bitmap stop corresponding pixels in the source bitmap from being transferred to the destination rectangle. With aInvertMask=ETrue, white pixels in the mask bitmap stop corresponding pixels in the source bitmap from being transferred to the destination rectangle.

Note that if the mask bitmap is smaller than the source bitmap, then it is tiled across the bitmap. Note that the mask is applied before the piece of the bitmap is defined - the mask is tiled relative to the top left of the original source bitmap rather than the top left of the bitmap piece.

This pure virtual function is implemented in derived classes.

ParameterDescription
aPointThe destination for the top left corner of the transferred bitmap. It is relative to the top left corner of the destination bitmap, which may be the screen.
aBitmapA memory-resident source bitmap.
aSourceRectA rectangle defining the piece of the bitmap to be drawn, with co-ordinates relative to the top left corner of the bitmap.
aMaskBitmapA mask bitmap
aInvertMaskIf EFalse, a source pixel that is masked by a black pixel is not transferred to the destination rectangle. If ETrue, then a source pixel that is masked by a white pixel is not transferred to the destination rectangle.

Clear ( )

voidClear()[pure virtual]

Clears the whole bitmap.

The cleared area is filled with the current brush colour.

This pure virtual function is implemented in derived classes.

Clear ( const TRect & )

voidClear(const TRect &aRect)[pure virtual]

Clears a rectangular area of a bitmap.

The cleared area is filled with the current brush colour.

This pure virtual function is implemented in derived classes.

ParameterDescription
aRectThe rectangle to clear.

CopyRect ( const TPoint &, const TRect & )

voidCopyRect(const TPoint &aOffset,
const TRect &aRect
)[pure virtual]

Copies a rectangle.

This pure virtual function is implemented in derived classes.

ParameterDescription
aOffsetThe offset from the top left corner of the rectangle to be copied to the top left corner of the copy.
aRectThe rectangular area to be copied.

Reserved_CBitmapContext_1 ( )

IMPORT_C voidReserved_CBitmapContext_1()[protected, virtual]

Reserved_CBitmapContext_2 ( )

IMPORT_C voidReserved_CBitmapContext_2()[protected, virtual]

Reserved_CBitmapContext_3 ( )

IMPORT_C voidReserved_CBitmapContext_3()[protected, virtual]

Reserved_CGraphicsContext_2 ( )

IMPORT_C voidReserved_CGraphicsContext_2()[protected, virtual]

A reserved virtual function for future use.

SetFaded ( TBool )

voidSetFaded(TBoolaFaded)[pure virtual]

Sets whether the graphics context is faded.

ParameterDescription
aFadedETrue to fade the GC; EFalse to unfade it.

SetFadingParameters ( TUint8, TUint8 )

voidSetFadingParameters(TUint8aBlackMap,
TUint8aWhiteMap
)[pure virtual]

Sets the fading parameters.

This function allows you to override the map used when drawing with a faded graphics context (GC). However if you draw to a faded window with a faded GC, then fading on the GC is ignored and the fading of the window is used.

Fading is used to change the colour of a window to make other windows stand out. Fading can either make a faded window closer to white or closer to black.

Fading re-maps colours in the faded GC to fall between the specified black and white map values. If aBlackMap=0 and aWhiteMap=255 then the colours are mapped unchanged. As the values converge the colours are mapped to a smaller range - so the differences between colours in the faded GC decrease. If the values are reversed then the colours are inverted (i.e. where the GC would be black, it is now white).

ParameterDescription
aBlackMapBlack map fading parameter. Unfaded this is 0.
aWhiteMapWhite map fading parameter. Unfaded this is 255.