|
||
class CBitmapContext : public CGraphicsContext;
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.
CBase
-
Base class for all classes to be instantiated on the heap.
CGraphicsContext
- Abstract base class for all graphics contexts.
CBitmapContext
- An abstract, device-independent, interface to bitmapped graphics contexts.
Defined in CBitmapContext
:
AlphaBlendBitmaps(const TPoint &,const CFbsBitmap *,const TRect &,const CFbsBitmap *,const TPoint &)
Performs an alpha blending of the source data, aSrcBmp, with the CBitmapContext,...AlphaBlendBitmaps(const TPoint &,const CWsBitmap *,const TRect &,const CWsBitmap *,const TPoint &)
The method performs an alpha blending of the source data, aSrcBmp, with the CBit...BitBlt(const TPoint &,const CFbsBitmap *)
Performs a bitmap block transfer.BitBlt(const TPoint &,const CFbsBitmap *,const TRect &)
Performs a bitmap block transfer of a rectangular piece of a bitmap.BitBltMasked(const TPoint &,const CFbsBitmap *,const TRect &,const CFbsBitmap *,TBool)
Performs a masked bitmap block transfer.Clear()
Clears the whole bitmap.Clear(const TRect &)
Clears a rectangular area of a bitmap.CopyRect(const TPoint &,const TRect &)
Copies a rectangle.Reserved_CBitmapContext_1()
Reserved_CBitmapContext_2()
Reserved_CBitmapContext_3()
Reserved_CGraphicsContext_2()
A reserved virtual function for future use.SetFaded(TBool)
Sets whether the graphics context is faded.SetFadingParameters(TUint8,TUint8)
Sets the fading parameters.Inherited from CBase
:
Delete(CBase *)
Deletes the specified object.Extension_(TUint,TAny *&,TAny *)
Extension function operator new(TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TAny *)
Initialises the object to binary zeroes.operator new(TUint,TLeave)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TLeave,TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TUint)
Allocates the object from the heap and then initialises its contents to binary z...Inherited from CGraphicsContext
:
CancelClippingRect()
Cancels any clipping rectangle.CancelClippingRegion()
Cancels the current clipping region. Device()const
Gets a pointer to the graphics context's graphics device.DiscardBrushPattern()
Discards a non-built-in brush pattern.DiscardFont()
Discards a font.DrawArc(const TRect &,const TPoint &,const TPoint &)
Draws an arc.DrawBitmap(const TPoint &,const CFbsBitmap *)
Draws a bitmap at the specified point.DrawBitmap(const TRect &,const CFbsBitmap *)
Draws a bitmap to fit a given rectangle.DrawBitmap(const TRect &,const CFbsBitmap *,const TRect &)
Draws a specified rectangle of a source bitmap to fit into a given destination r...DrawBitmapMasked(const TRect &,const CFbsBitmap *,const TRect &,const CFbsBitmap *,TBool)
Draws a specified rectangle of a source bitmap to fit into a given rectangle usi...DrawBitmapMasked(const TRect &,const CWsBitmap *,const TRect &,const CWsBitmap *,TBool)
Draws a specified rectangle from a wserv bitmap and its mask into another rectan...DrawEllipse(const TRect &)
Draws and fills an ellipse.DrawLine(const TPoint &,const TPoint &)
Draws a straight line between two points.DrawLineBy(const TPoint &)
Draws a straight line relative to the current drawing point, using a vector.DrawLineTo(const TPoint &)
Draws a straight line from the current drawing point to a specified point.DrawPie(const TRect &,const TPoint &,const TPoint &)
Draws and fills a pie slice.DrawPolyLine(const CArrayFix< TPoint > *)
Draws a polyline from a set of points in an array.DrawPolyLine(const TPoint *,TInt)
Draws a polyline from a set of points in a list.DrawPolygon(const CArrayFix< TPoint > *,TFillRule)
Draws and fills a polygon defined using an array of points.DrawPolygon(const TPoint *,TInt,TFillRule)
Draws and fills a polygon defined using a list of points.DrawRect(const TRect &)
Draws and fills a rectangle.DrawRoundRect(const TRect &,const TSize &)
Draws and fills a rectangle with rounded corners.DrawText(const TDesC &,const TPoint &)
Draws text without a surrounding box.DrawText(const TDesC &,const TPoint &,const TDrawTextParam &)
Draws the specified text at the given position using the parameters supplied.DrawText(const TDesC &,const TRect &,TInt,TTextAlign,TInt)
Draws text inside a box.DrawTextExtended(const TDesC &,const TPoint &,const TDrawTextExtendedParam &)
Draws text, optionally changing its direction (right-to-left / left-to-right).DrawTextVertical(const TDesC &,const TPoint &,TBool)
Draws vertical text in the specified direction. DrawTextVertical(const TDesC &,const TRect &,TInt,TBool,TTextAlign,TInt)
Draws text vertically in the specified direction, within a box of the specified ...EAlternate
Only fill areas with odd winding numbers. EAnd
8 ECenter
Text is centred. EDashedPen
A dashed line. Screen pattern unit = 111000... EDiamondCrossHatchBrush
The brush fills with forward diagonal and rearward diagonal hatching lines going...EDotDashPen
A line of alternating dashes and dots. Screen pattern unit = 1111001100... EDotDotDashPen
A line of alternating single dashes and pairs of dots. Screen pattern unit = 111...EDottedPen
A dotted line. Screen pattern unit = 1000... EDrawModeAND
Bitwise ANDs the pen and brush colours with the screen colour. P=p&s, B=b&am...EDrawModeANDNOT
Inverts the screen colour before ANDing. P=p&(~s), B=b&(~s) EDrawModeNOTAND
Inverts the pen and brush colours before ANDing. P=(~p)&s, B=(~b)&s EDrawModeNOTANDNOT
Inverts the screen and pen and brush colours before ANDing. P=(~p)&(~s), B=(...EDrawModeNOTOR
Inverts the pen and brush colours before ORing. P=(~p)|s, B=(~b)|s EDrawModeNOTORNOT
NOT OR NOT mode. P=(~p)|(~s), B=(~b)|(~s) EDrawModeNOTPEN
Inverts the pen and brush colours. P=~p, B=~b EDrawModeNOTSCREEN
Inverts the colour of each pixel that is drawn over, (pen and brush attributes a...EDrawModeNOTXOR
Inverts the pen and brush colours before XORing. P=(~p)^s, B=(~b)^s EDrawModeOR
Bitwise ORs the pen and brush colours with the screen colour. P=p|s, B=b|s EDrawModeORNOT
Inverts the screen, pen and brush colours before ORing. P=p|(~s), B=b|(~s) EDrawModePEN
Uses both pen and brush colour as they are. P=p, B=b EDrawModeWriteAlpha
Writes alpha information in the source directly into the destination, rather tha...EDrawModeXOR
Bitwise XORs the pen and brush colours with the screen colour. P=p^s, B=b^s EForwardDiagonalHatchBrush
The brush fills with diagonal hatching lines going from bottom left to top right...EHorizontalHatchBrush
The brush fills with horizontal hatching lines going from left to right. EInvertPen
16 EInvertScreen
1 ELeft
Text is left-aligned. ELogicalOp
14 ENullBrush
The brush fill has no effect (default). ENullPen
The pen does not draw. Screen pattern unit = 00... EOr
4 EPatternedBrush
The brush fills with a selected bitmap pattern, set by CGraphicsContext::UseBrus...EPenmode
32 ERearwardDiagonalHatchBrush
The brush fills with rearward diagonal hatching lines going from top left to bot...ERight
Text is right-aligned. ESolidBrush
The brush fills with a solid single colour, determined by CGraphicsContext::SetB...ESolidPen
A solid line (default). Screen pattern unit = 11... ESquareCrossHatchBrush
The brush fills with horizontal and vertical hatching lines going from left to r...EVerticalHatchBrush
The brush fills with vertical hatching lines going from top to bottom. EWinding
Fill areas with winding numbers greater than zero. EWriteAlpha
64 EXor
2 GetShadowColor(TRgb &)
Get the font's shadow colour GetUnderlineMetrics(TInt &,TInt &)
JustificationInPixels(TInt &,TInt &)
Gets the amount of space in pixels by which to adjust the current letter or word...JustificationInPixels(TInt,TInt,TInt,TInt)
Gets the amount of space in pixels by which to adjust letter or word spacing, gi...MapColors(const TRect &,const TRgb *,TInt,TBool)
Maps pixels in the specified rectangle. The function tries to match the colour o...MoveBy(const TPoint &)
Sets the drawing point relative to the current co-ordinates.MoveTo(const TPoint &)
Sets the drawing point relative to the co-ordinate origin.Plot(const TPoint &)
Draws a single point. The point is drawn with the current pen settings using the...Reserved()
Reserved function for future use. Reset()
Resets the graphics context to its default settings:SetBrushColor(const TRgb &)
Sets the brush colour.SetBrushOrigin(const TPoint &)
Sets the brush pattern origin.SetBrushStyle(TBrushStyle)
Sets the brush style.SetCharJustification(TInt,TInt)
Sets character justification.SetClippingRect(const TRect &)
Sets the clipping rectangle.SetClippingRegion(const TRegion &)
Sets the clipping region. SetDrawMode(TDrawMode)
Sets the drawing mode.SetOrigin(const TPoint &)
Sets the position of the co-ordinate origin.SetPenColor(const TRgb &)
Sets the pen colour.SetPenSize(const TSize &)
Sets the line drawing size for the pen.SetPenStyle(TPenStyle)
Sets the line drawing style for the pen.SetShadowColor(const TRgb &)
Set the font's shadow colour SetStrikethroughStyle(TFontStrikethrough)
Sets the strikethrough style.SetUnderlineStyle(TFontUnderline)
Sets the underline style.SetWordJustification(TInt,TInt)
Adjusts the spaces between words to stretch or squeeze to a certain width.TBrushStyle
Brush styles. TDrawMode
Drawing modes.TDrawModeComponents
Drawing mode components. This enum is not intended to be used directly, but prov...TDrawTextExtendedParam
Parameters for extended text drawing and measuring. It is used by CGraphicsConte...TDrawTextParam
Parameters to control the drawing of text. TFillRule
Rules used to fill self crossing polygons.TPenStyle
Pen styles. The screen pattern unit in each definition below describes the patte...TTextAlign
Text alignment. UseBrushPattern(const CFbsBitmap *)
Sets the brush pattern to the specified bitmap.UseFont(const CFont *)
Sets the device font to be used for text drawing.virtual void Clear()=0;
Clears the whole bitmap.
The cleared area is filled with the current brush colour.
This pure virtual function is implemented in derived classes.
virtual void Clear(const TRect &aRect)=0;
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.
|
virtual void CopyRect(const TPoint &aOffset, const TRect &aRect)=0;
Copies a rectangle.
This pure virtual function is implemented in derived classes.
|
virtual void BitBlt(const TPoint &aPoint, const CFbsBitmap *aBitmap)=0;
Performs a bitmap block transfer.
This pure virtual function is implemented in derived classes.
|
virtual void BitBlt(const TPoint &aPoint, const CFbsBitmap *aBitmap, const TRect &aRect)=0;
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.
|
virtual void BitBltMasked(const TPoint &aPoint, const CFbsBitmap *aBitmap, const TRect &aSourceRect, const CFbsBitmap *aMaskBitmap,
TBool aInvertMask)=0;
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.
|
virtual void SetFaded(TBool aFaded)=0;
Sets whether the graphics context is faded.
|
virtual void SetFadingParameters(TUint8 aBlackMap, TUint8 aWhiteMap)=0;
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).
|
AlphaBlendBitmaps(const TPoint &,const CFbsBitmap *,const TRect &,const CFbsBitmap *,const TPoint &)
virtual TInt AlphaBlendBitmaps(const TPoint &aDestPt, const CFbsBitmap *aSrcBmp, const TRect &aSrcRect, const CFbsBitmap *aAlphaBmp,
const TPoint &aAlphaPt)=0;
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.
|
|
virtual TInt AlphaBlendBitmaps(const TPoint &aDestPt, const CWsBitmap *aSrcBmp, const TRect &aSrcRect, const CWsBitmap *aAlphaBmp,
const TPoint &aAlphaPt)=0;
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.
|
|
protected: IMPORT_C virtual void Reserved_CGraphicsContext_2();
A reserved virtual function for future use.
protected: IMPORT_C virtual void Reserved_CBitmapContext_3();