Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: gdi.h
Link against: n/a

Class CBitmapContext

CBitmapContext

Support

Supported from 5.0

Description

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

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

The classes CFbsBitGc and CWindowGc are derived from this class.

Derivation

CBaseBase class for all classes to be instantiated on the heap
CBitmapContextAn abstract, device-independent, interface to bitmapped graphics contexts
CGraphicsContextAbstract, device independent, interface to graphics contexts

Defined in CBitmapContext:
BitBlt(), BitBltMasked(), Clear(), CopyRect(), SetFaded(), SetFadingParameters()

Inherited from CBase:
operator new()

Inherited from CGraphicsContext:
CancelClippingRect(), Device(), DiscardBrushPattern(), DiscardFont(), DrawArc(), DrawBitmap(), DrawEllipse(), DrawLine(), DrawLineBy(), DrawLineTo(), DrawPie(), DrawPolyLine(), DrawPolygon(), DrawRect(), DrawRoundRect(), DrawText(), EAlternate, EAnd, ECenter, EDashedPen, EDiamondCrossHatchBrush, EDotDashPen, EDotDotDashPen, EDottedPen, EDrawModeAND, EDrawModeANDNOT, EDrawModeNOTAND, EDrawModeNOTANDNOT, EDrawModeNOTOR, EDrawModeNOTORNOT, EDrawModeNOTPEN, EDrawModeNOTSCREEN, EDrawModeNOTXOR, EDrawModeOR, EDrawModeORNOT, EDrawModePEN, EDrawModeXOR, EForwardDiagonalHatchBrush, EHorizontalHatchBrush, EInvertPen, EInvertScreen, ELeft, ELogicalOp, ENullBrush, ENullPen, EOr, EPatternedBrush, EPenmode, ERearwardDiagonalHatchBrush, ERight, ESolidBrush, ESolidPen, ESquareCrossHatchBrush, EVerticalHatchBrush, EWinding, EXor, JustificationInPixels(), MoveBy(), MoveTo(), Plot(), Reset(), SetBrushColor(), SetBrushOrigin(), SetBrushStyle(), SetCharJustification(), SetClippingRect(), SetDrawMode(), SetOrigin(), SetPenColor(), SetPenSize(), SetPenStyle(), SetStrikethroughStyle(), SetUnderlineStyle(), SetWordJustification(), TBrushStyle, TDrawMode, TDrawModeComponents, TDrawTextParam, TFillRule, TPenStyle, TTextAlign, UseBrushPattern(), UseFont()

See also:


Clearing and copying rectangular areas


Clear()

virtual void Clear()=0;

Description

Clears the whole bitmap.

The cleared area is filled with the current brush colour.

This pure virtual function is implemented in derived classes.


Clear()

virtual void Clear(const TRect& aRect)=0;

Description

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.

Parameters

const TRect& aRect

The rectangle to clear.


CopyRect()

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

Description

Copies a rectangle.

This pure virtual function is implemented in derived classes.

Parameters

const TPoint& aOffset

The offset from the top left corner of the rectangle to be copied to the top left corner of the copy.

const TRect& aRect

The rectangular area to be copied.

[Top]


Bitmap block transfer


BitBlt()

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

Description

Performs a bitmap block transfer.

This pure virtual function is implemented in derived classes.

Parameters

const TPoint& aPoint

A position for the top left corner of the bitmap.

const CFbsBitmap* aBitmap

A memory-resident bitmap.


BitBlt()

virtual void BitBlt(const TPoint& aPoint,const CFbsBitmap* aBitmap,const TRect& aRect)=0;

Description

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.

Parameters

const TPoint& aPoint

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

const CFbsBitmap* aBitmap

A memory-resident bitmap

const TRect& aRect

A rectangle defining the piece of the bitmap to be drawn, with co-ordinates relative to the top left corner of the bitmap


BitBltMasked()

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

Description

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.

A black and white (binary) mask bitmap is used. With aInvertMask=ETrue, black pixels in the mask bitmap stop corresponding pixels in the source bitmap from being transferred to the destination rectangle. With aInvertMask=EFalse, 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.

Parameters

const TPoint& aPoint

A position for the top left corner of the bitmap.

const CFbsBitmap* aBitmap

A memory-resident source bitmap.

const TRect& aSourceRect

A rectangle defining the piece of the bitmap to be drawn, with co-ordinates relative to the top left corner of the bitmap.

const CFbsBitmap* aMaskBitmap

A mask bitmap

TBool aInvertMask

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


SetFaded()

virtual void SetFaded(TBool aFaded)=0;

Support

Supported from 6.0

Description

Sets whether the graphics context is faded.

Parameters

TBool aFaded

ETrue to fade the GC; EFalse to unfade it.


SetFadingParameters()

virtual void SetFadingParameters(TUint8 aBlackMap,TUint8 aWhiteMap)=0;

Support

Supported from 6.0

Description

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 it will use the fading of the window.

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

Parameters

TUint8 aBlackMap

Black map fading parameter. Unfaded this is 0.

TUint8 aWhiteMap

White map fading parameter. Unfaded this is 255.