|
Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
|
Window graphics context. More...
#include <w32std.h>
Public Member Functions | |
| IMPORT_C | CWindowGc (CWsScreenDevice *aDevice) |
| Constructor which creates, but does not initialise a graphics context. | |
| virtual IMPORT_C | ~CWindowGc () |
| Destructor. | |
| virtual IMPORT_C TInt | Construct () |
| Completes construction. | |
| virtual IMPORT_C void | Activate (RDrawableWindow &aDevice) |
| Activates the context for a given window and updates iDevice with the pointer to the screen device of the screen on which aDevice is found. | |
| virtual IMPORT_C void | Deactivate () |
| Frees the graphics context to be used with another window. | |
| virtual IMPORT_C CGraphicsDevice * | Device () const |
| Gets a pointer to the graphics context's graphics device. | |
| virtual IMPORT_C void | SetOrigin (const TPoint &aPoint=TPoint(0, 0)) |
| Sets the position of the co-ordinate origin. | |
| virtual IMPORT_C void | SetDrawMode (TDrawMode aDrawingMode) |
| Sets the drawing mode. | |
| virtual IMPORT_C void | SetClippingRect (const TRect &aRect) |
| Sets the clipping rectangle. | |
| virtual IMPORT_C void | CancelClippingRect () |
| Cancels any clipping rectangle. | |
| virtual IMPORT_C void | Reset () |
| Resets the graphics context to its default settings: | |
| virtual IMPORT_C void | UseFont (const CFont *aFont) |
| Sets the device font to be used for text drawing. | |
| virtual IMPORT_C void | DiscardFont () |
| Discards a font. | |
| virtual IMPORT_C void | SetUnderlineStyle (TFontUnderline aUnderlineStyle) |
| Sets the underline style. | |
| virtual IMPORT_C void | SetStrikethroughStyle (TFontStrikethrough aStrikethroughStyle) |
| Sets the strikethrough style. | |
| virtual IMPORT_C void | SetWordJustification (TInt aExcessWidth, TInt aNumGaps) |
| Adjusts the spaces between words to stretch or squeeze to a certain width. | |
| virtual IMPORT_C void | SetCharJustification (TInt aExcessWidth, TInt aNumChars) |
| Sets character justification. | |
| virtual IMPORT_C void | SetPenColor (const TRgb &aColor) |
| Sets the pen colour. | |
| virtual IMPORT_C void | SetPenStyle (TPenStyle aPenStyle) |
| Sets the line drawing style for the pen. | |
| virtual IMPORT_C void | SetPenSize (const TSize &aSize) |
| Sets the line drawing size for the pen. | |
| virtual IMPORT_C void | SetBrushColor (const TRgb &aColor) |
| Sets the brush colour. | |
| virtual IMPORT_C void | SetBrushStyle (TBrushStyle aBrushStyle) |
| Sets the brush style. | |
| virtual IMPORT_C void | SetBrushOrigin (const TPoint &aOrigin) |
| Sets the brush pattern origin. | |
| virtual IMPORT_C void | UseBrushPattern (const CFbsBitmap *aDevice) |
| Sets the brush pattern to the specified bitmap. | |
| virtual IMPORT_C void | DiscardBrushPattern () |
| Discards a non-built-in brush pattern. | |
| virtual IMPORT_C void | MoveTo (const TPoint &aPoint) |
| Sets the drawing point relative to the co-ordinate origin. | |
| virtual IMPORT_C void | MoveBy (const TPoint &aPoint) |
| Sets the drawing point relative to the current co-ordinates. | |
| virtual IMPORT_C void | Plot (const TPoint &aPoint) |
| Draws a single point. | |
| virtual IMPORT_C void | DrawArc (const TRect &aRect, const TPoint &aStart, const TPoint &aEnd) |
| Draws an arc. | |
| virtual IMPORT_C void | DrawLine (const TPoint &aPoint1, const TPoint &aPoint2) |
| Draws a straight line between two points. | |
| virtual IMPORT_C void | DrawLineTo (const TPoint &aPoint) |
| Draws a straight line from the current drawing point to a specified point. | |
| virtual IMPORT_C void | DrawLineBy (const TPoint &aPoint) |
| Draws a straight line relative to the current drawing point, using a vector. | |
| virtual IMPORT_C void | DrawPolyLine (const CArrayFix< TPoint > *aPointList) |
| Draws a polyline from a set of points in an array. | |
| virtual IMPORT_C void | DrawPolyLine (const TPoint *aPointList, TInt aNumPoints) |
| Draws a polyline from a set of points in a list. | |
| virtual IMPORT_C void | DrawPie (const TRect &aRect, const TPoint &aStart, const TPoint &aEnd) |
| Draws and fills a pie slice. | |
| virtual IMPORT_C void | DrawEllipse (const TRect &aRect) |
| Draws and fills an ellipse. | |
| virtual IMPORT_C void | DrawRect (const TRect &aRect) |
| Draws and fills a rectangle. | |
| virtual IMPORT_C void | DrawRoundRect (const TRect &aRect, const TSize &aEllipse) |
| Draws and fills a rectangle with rounded corners. | |
| virtual IMPORT_C TInt | DrawPolygon (const CArrayFix< TPoint > *aPointList, TFillRule aFillRule=EAlternate) |
| Draws and fills a polygon defined using an array of points. | |
| virtual IMPORT_C TInt | DrawPolygon (const TPoint *aPointList, TInt aNumPoints, TFillRule aFillRule=EAlternate) |
| Draws and fills a polygon defined using a list of points. | |
| virtual IMPORT_C void | DrawBitmap (const TPoint &aTopLeft, const CFbsBitmap *aDevice) |
| Draws a bitmap at the specified point. | |
| virtual IMPORT_C void | DrawBitmap (const TRect &aDestRect, const CFbsBitmap *aDevice) |
| Draws a bitmap to fit a given rectangle. | |
| virtual IMPORT_C void | DrawBitmap (const TRect &aDestRect, const CFbsBitmap *aDevice, const TRect &aSourceRect) |
| Draws a specified rectangle of a source bitmap to fit into a given destination rectangle. | |
| virtual IMPORT_C void | DrawBitmapMasked (const TRect &aDestRect, const CFbsBitmap *aBitmap, const TRect &aSourceRect, const CFbsBitmap *aMaskBitmap, TBool aInvertMask) |
| Draws a specified rectangle of a source bitmap to fit into a given rectangle using a given mask. | |
| virtual IMPORT_C void | DrawBitmapMasked (const TRect &aDestRect, const CWsBitmap *aBitmap, const TRect &aSourceRect, const CWsBitmap *aMaskBitmap, TBool aInvertMask) |
| Draws a specified rectangle from a wserv bitmap and its mask into another rectangle. | |
| virtual IMPORT_C void | DrawText (const TDesC &aBuf, const TPoint &aPos) |
| Draws text without a surrounding box. | |
| virtual IMPORT_C void | DrawText (const TDesC &aBuf, const TRect &aBox, TInt aBaselineOffset, TTextAlign aHoriz=ELeft, TInt aLeftMrg=0) |
| Draws text inside a box. | |
| virtual IMPORT_C void | Clear () |
| Clears the whole bitmap. | |
| virtual IMPORT_C void | Clear (const TRect &aRect) |
| Clears a rectangular area of a bitmap. | |
| virtual IMPORT_C void | CopyRect (const TPoint &anOffset, const TRect &aRect) |
| Copies a rectangle. | |
| virtual IMPORT_C void | BitBlt (const TPoint &aPos, const CFbsBitmap *aBitmap) |
| Performs a bitmap block transfer. | |
| virtual IMPORT_C void | BitBlt (const TPoint &aDestination, const CFbsBitmap *aBitmap, const TRect &aSource) |
| Performs a bitmap block transfer of a rectangular piece of a bitmap. | |
| virtual IMPORT_C void | BitBltMasked (const TPoint &aPoint, const CFbsBitmap *aBitmap, const TRect &aSourceRect, const CFbsBitmap *aMaskBitmap, TBool aInvertMask) |
| Performs a masked bitmap block transfer. | |
| virtual IMPORT_C void | BitBlt (const TPoint &aPoint, const CWsBitmap *aBitmap) |
| Performs a bitmap block transfer on a bitmap to which the window server already has a handle. | |
| virtual IMPORT_C void | BitBlt (const TPoint &aDestination, const CWsBitmap *aBitmap, const TRect &aSource) |
| Performs a bitmap block transfer of a rectangular piece of a bitmap to which the window server already has a handle. | |
| virtual IMPORT_C void | BitBltMasked (const TPoint &aPoint, const CWsBitmap *aBitmap, const TRect &aSourceRect, const CWsBitmap *aMaskBitmap, TBool aInvertMask) |
| Performs a masked bitmap block transfer of a window server bitmap. | |
| virtual IMPORT_C void | MapColors (const TRect &aRect, const TRgb *aColors, TInt aNumPairs=2, TBool aMapForwards=ETrue) |
| Maps pixels in the specified rectangle. | |
| virtual IMPORT_C void | DrawTextVertical (const TDesC &aText, const TPoint &aPos, TBool aUp) |
| Draws vertical text in the specified direction. | |
| virtual IMPORT_C void | DrawTextVertical (const TDesC &aText, const TRect &aBox, TInt aBaselineOffset, TBool aUp, TTextAlign aVert=ELeft, TInt aMargin=0) |
| Draws text vertically in the specified direction, within a box of the specified size. | |
| virtual IMPORT_C void | SetDitherOrigin (const TPoint &aPoint) |
| Sets the origin used for colour dithering. | |
| virtual IMPORT_C TInt | SetClippingRegion (const TRegion &aRegion) |
| Sets the clipping region, any items that fall outside the extent of the clipping region will not be drawn. | |
| virtual IMPORT_C void | CancelClippingRegion () |
| Cancels the current clipping region. | |
| virtual IMPORT_C void | SetOpaque (TBool aDrawOpaque=ETrue) |
| Sets and unsets an opaque flag on the window. | |
| virtual IMPORT_C void | SetFaded (TBool aFaded) |
| Sets whether the graphics context is faded. | |
| virtual IMPORT_C void | SetFadingParameters (TUint8 aBlackMap, TUint8 aWhiteMap) |
| Sets the fading parameters. | |
| virtual IMPORT_C TInt | AlphaBlendBitmaps (const TPoint &aDestPt, const CFbsBitmap *aSrcBmp, const TRect &aSrcRect, const CFbsBitmap *aAlphaBmp, const TPoint &aAlphaPt) |
| Performs an alpha blending of the source data, aSrcBmp, with the CBitmapContext, using the data from aAlphaBmp as an alpha blending factor. | |
| virtual IMPORT_C TInt | AlphaBlendBitmaps (const TPoint &aDestPt, const CWsBitmap *aSrcBmp, const TRect &aSrcRect, const CWsBitmap *aAlphaBmp, const TPoint &aAlphaPt) |
| The method performs an alpha blending of the source data, aSrcBmp, with the CBitmapContext, using the data from aAlphaBmp as an alpha blending factor. | |
| IMPORT_C TAny * | Interface (TUid aInterfaceId) |
| IMPORT_C const TAny * | Interface (TUid aInterfaceId) const |
| virtual IMPORT_C void | DrawWsGraphic (const TWsGraphicId &aId, const TRect &aDestRect) |
| Draws an abstract artwork. | |
| virtual IMPORT_C void | DrawWsGraphic (const TWsGraphicId &aId, const TRect &aDestRect, const TDesC8 &aData) |
| Draws an abstract artwork. | |
Public Member Functions inherited from CGraphicsContext | |
| virtual IMPORT_C void | DrawText (const TDesC &aText, const TPoint &aPosition, const TDrawTextParam &aParam) |
| Draws the specified text at the given position using the parameters supplied. | |
| virtual IMPORT_C void | Reserved () |
| Reserved function for future use. | |
| IMPORT_C TInt | DrawTextExtended (const TDesC &aText, const TPoint &aPosition, const TDrawTextExtendedParam &aParam) |
| Draws text, optionally changing its direction (right-to-left / left-to-right). | |
| IMPORT_C TInt | GetUnderlineMetrics (TInt &aTop, TInt &aBottom) |
| IMPORT_C TInt | SetShadowColor (const TRgb &aShadowColor) |
| Set the font's shadow colour. | |
| IMPORT_C TInt | GetShadowColor (TRgb &aShadowColor) |
| Get the font's shadow colour. | |
| IMPORT_C TBool | IsFbsBitGc () const |
| Determine if the Gc is a CFbsBitGc. | |
| IMPORT_C void | DrawText (const TDesC &aText, const TTextParameters *iParam, const TPoint &aPosition) |
| IMPORT_C void | DrawText (const TDesC &aText, const TTextParameters *iParam, const TRect &aBox, TInt aBaselineOffset, TTextAlign aHrz=ELeft, TInt aMargin=0) |
| IMPORT_C void | DrawText (const TDesC &aText, const TTextParameters *iParam, const TPoint &aPosition, const TDrawTextParam &aParam) |
| IMPORT_C void | DrawTextVertical (const TDesC &aText, const TTextParameters *iParam, const TPoint &aPos, TBool aUp) |
| IMPORT_C void | DrawTextVertical (const TDesC &aText, const TTextParameters *iParam, const TRect &aBox, TInt aBaselineOffset, TBool aUp, TTextAlign aVert=ELeft, TInt aMargin=0) |
| IMPORT_C TInt | DrawTextExtended (const TDesC &aText, const TTextParameters *iParam, const TPoint &aPosition, const TDrawTextExtendedParam &aParam) |
| Draws text, optionally changing its direction (right-to-left / left-to-right). | |
Public Member Functions inherited from CBase | |
| CBase () | |
| Default constructor. | |
| virtual IMPORT_C | ~CBase () |
| Virtual destructor. | |
| TAny * | operator new (TUint aSize, TAny *aBase) __NO_THROW |
| Initialises the object to binary zeroes. | |
| TAny * | operator new (TUint aSize) __NO_THROW |
| Allocates the object from the heap and then initialises its contents to binary zeroes. | |
| TAny * | operator new (TUint aSize, TLeave) |
| Allocates the object from the heap and then initialises its contents to binary zeroes. | |
| TAny * | operator new (TUint aSize, TUint aExtraSize) __NO_THROW |
| Allocates the object from the heap and then initialises its contents to binary zeroes. | |
| TAny * | operator new (TUint aSize, TLeave, TUint aExtraSize) |
| Allocates the object from the heap and then initialises its contents to binary zeroes. | |
Public Member Functions inherited from MWsClientClass | |
| MWsClientClass () | |
| MWsClientClass (RWsBuffer *aBuffer) | |
| TInt | WsHandle () const |
| Gets the server side handle for the object. | |
Protected Member Functions | |
| IMPORT_C TInt | APIExtension (TUid aUid, TAny *&aOutput, TAny *aInput) |
Protected Member Functions inherited from CBase | |
| virtual IMPORT_C TInt | Extension_ (TUint aExtensionId, TAny *&a0, TAny *a1) |
| Extension function. | |
Protected Member Functions inherited from MWsClientClass | |
| void | Write (const TAny *aData1, TInt aLength1, TInt aLength2, TUint aOpcode) const |
| void | Write (const TAny *aData, TInt aLength, const TAny *aData2, TInt aLength2, TUint aOpcode, const TIpcArgs *aIpcArgs=NULL) const |
| void | Write (const TAny *aBuf, TInt aBufLen, TUint aOpcode, const TIpcArgs *aIpcArgs=NULL) const |
| void | Write (TUint aOpcode) const |
| void | WriteInt (TInt aInt, TUint aOpcode) const |
| void | WriteRect (const TRect &aRect, TUint aOpcode) const |
| void | WritePoint (const TPoint &aPoint, TUint aOpcode) const |
| void | WriteSize (const TSize &aSize, TUint aOpcode) const |
| TInt | WriteReply (TUint aOpcode, const TIpcArgs *aIpcArgs=NULL) const |
| TInt | WriteReplyInt (TInt aInt, TUint aOpcode, const TIpcArgs *aIpcArgs=NULL) const |
| TInt | WriteReply (const TAny *aBuf, TInt aBufLen, TUint aOpcode, const TIpcArgs *aIpcArgs=NULL) const |
| TInt | WriteReply (const TAny *aBuf, TInt aBufLen, const TAny *aBuf2, TInt aBuflen2, TUint aOpcode, const TIpcArgs *aIpcArgs=NULL) const |
| TInt | WriteReplyP (const TWriteDescriptorType &aReplyPackage, TUint aOpcode) const |
| TInt | WriteReplyIntP (TInt aInt, const TWriteDescriptorType &aReplyPackage, TUint aOpcode) const |
| TInt | WriteReplyP (const TAny *aBuf, TInt aBufLen, const TWriteDescriptorType &aReplyPackage, TUint aOpcode) const |
| TInt | WriteReplyP (const TAny *aBuf, TInt aBufLen, const TAny *aBuf2, TInt aBuflen2, const TWriteDescriptorType &aReplyPackage, TUint aOpcode) const |
| TInt | WriteReplyByProvidingRemoteReadAccess (const TAny *aBuf, TInt aBufLen, const TReadDescriptorType &aRemoteReadBuffer, TUint aOpcode) const |
| void | AddToBitmapArray (const TInt aBitmapHandle) const |
| void | AsyncRequest (TRequestStatus &aStatus, TUint aOpcode) const |
| TBool | WindowSizeCacheEnabled () const |
| void | MarkWindowSizeCacheDirty () |
| void | RefreshWindowSizeCache (const TSize &aNewSize) const |
| TInt | CachedWindowSize (TSize &aSize) const |
| void | DestroyWindowSizeCacheEntry () |
Friends | |
| class | CWsScreenDevice |
Additional Inherited Members | |
Static Public Member Functions inherited from CGraphicsContext | |
| static IMPORT_C TInt | JustificationInPixels (TInt aExcessPixels, TInt aTotalUnits, TInt aFirstUnit, TInt aNumUnits) |
| Gets the amount of space in pixels by which to adjust letter or word spacing, given the total number of words and spaces, a start space, and the number of units to be adjusted. | |
| static IMPORT_C TInt | JustificationInPixels (TInt &aExcessPixels, TInt &aTotalUnits) |
| Gets the amount of space in pixels by which to adjust the current letter or word spacing, and also retrieves the number of excess pixels and word spaces remaining after the adjustment is performed. | |
Static Public Member Functions inherited from CBase | |
| static IMPORT_C void | Delete (CBase *aPtr) |
| Deletes the specified object. | |
Protected Attributes inherited from MWsClientClass | |
| TInt32 | iWsHandle |
| WARNING: Member variable for internal use ONLY. | |
| RWsBuffer * | iBuffer |
| WARNING: Member variable for internal use ONLY. | |
Window graphics context.
Most window graphics context drawing functions map to equivalent CFbsBitGc functions. They are implemented on the screen with any co-ordinates being relative to the top left corner of the window. However extra clipping is applied. The drawing will always be clipped to the visible part of the window. In addition it will be clipped to the non-invalid part if you are not doing a redraw and to the region being validated if you are doing a redraw.
Note:
In general, server side functions which encounter conditions which would normally cause a leave, do not leave but instead return an error value indicating the leave condition. In this way the leave can be handled on the appropriate side of the client/server boundary. For example, a client can choose to wrap server calls with User::LeaveIfError(), which causes a leave with the specified error.
The above advice is true of many functions in this class, and in its derived classes.
Defines possible clockwise rotation values.
WARNING: Enum for internal and partner use ONLY. Compatibility is not guaranteed in future releases.
| Enumerator | |
|---|---|
| EGraphicsRotationNone | No rotation. |
| EGraphicsRotation90 | A 90 degree rotation. |
| EGraphicsRotation180 | A 180 degree rotation. |
| EGraphicsRotation270 | A 270 degree rotation. |
| IMPORT_C CWindowGc::CWindowGc | ( | CWsScreenDevice * | aDevice | ) |
Constructor which creates, but does not initialise a graphics context.
CWsScreenDevice::CreateContext()
| aDevice | Any screen device owned by the same session. Its life time should be at least as long as the gc itself. |
(generated from Symbian Developer Library)
|
virtual |
Destructor.
(generated from Symbian Developer Library)
|
virtual |
Activates the context for a given window and updates iDevice with the pointer to the screen device of the screen on which aDevice is found.
When drawing is complete, the code using the context should call Deactivate(). Draw methods invoked after an Activate() will affect the window specified. A graphics context can only be active for one window at a time. A panic occurs if a draw function is called before calling this function, or if Activate() is called twice without an intervening Deactivate().
(generated from Symbian Developer Library)
|
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:
| aDestPt | Position in the target the result should be drawn to. |
| aSrcBmp | A pointer to the source bitmap. |
| aSrcRect | The part of the source bitmap that should be used. |
| aAlphaBmp | A pointer to the bitmap used as an alpha blending factor. |
| 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. |
Implements CBitmapContext.
|
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.
| aDestPt | Position in the target the result should be drawn to. |
| aSrcBmp | A pointer to the source bitmap. |
| aSrcRect | The part of the source bitmap that should be used. |
| aAlphaBmp | A pointer to the bitmap used as an alpha blending factor. |
| 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. |
Implements CBitmapContext.
|
protectedvirtual |
| aUid | The unique identifier for the method that is required. Selected internally by a series of "if" statements. |
| aOutput | is a TAny pointer to a reference. Used to output data as the structure does not need to be instantiated before the function call this adds greater flexibility. |
| aInput | is a TAny pointer used to input data. |
(generated from Symbian Developer Library)
Reimplemented from CBitmapContext.
|
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.
| aPoint | The 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. |
| aBitmap | A memory-resident bitmap |
| aRect | A rectangle defining the portion of the bitmap to transfer. Its coordinates are relative to the top left corner of the source bitmap. |
Implements CBitmapContext.
|
virtual |
Performs a bitmap block transfer of a rectangular piece of a bitmap to which the window server already has a handle.
Windows that store their redraw commands will only store drawing position and a handle to bitmaps that are drawn in it. The bitmap handle is just a pointer to the bitmap in the FBSERV heap. At some point later WSERV may need to draw that window again and it will just replay the stored commands including the draw bitmap. However, if the client has changed the content of the bitmap, WSERV will effectively draw a different bitmap when it replays the commands.
This function should be used in preference to the CFbsBitmap overload if the bitmap is to be used more than once, as it is a lot quicker.
Note: if the rectangle aSource is larger than the bitmap then the bitmap will be padded with white.
| aDestination | The position for the top left corner of the bitmap. |
| aBitmap | A window server bitmap. |
| aSource | A rectangle defining the piece of the bitmap to be drawn, with co-ordinates relative to the top left corner of the bitmap |
(generated from Symbian Developer Library)
Performs a bitmap block transfer on a bitmap to which the window server already has a handle.
Windows that store their redraw commands will only store drawing position and a handle to bitmaps that are drawn in it. The bitmap handle is just a pointer to the bitmap in the FBSERV heap. At some point later WSERV may need to draw that window again and it will just replay the stored commands including the draw bitmap. However, if the client has changed the content of the bitmap, WSERV will effectively draw a different bitmap when it replays the commands.
This function should be used in preference to the CFbsBitmap overload if the bitmap is to be used more than once, as it is a lot quicker.
| aPoint | The position for the top left corner of the bitmap. |
| aBitmap | A window server bitmap. |
(generated from Symbian Developer Library)
|
virtual |
Performs a bitmap block transfer.
This pure virtual function is implemented in derived classes.
| aPoint | The 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. |
| aBitmap | A memory-resident bitmap. |
Implements CBitmapContext.
|
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.
| aPoint | The 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. |
| aBitmap | A memory-resident source bitmap. |
| aSourceRect | A rectangle defining the piece of the bitmap to be drawn, with co-ordinates relative to the top left corner of the bitmap. |
| aMaskBitmap | A mask bitmap |
| aInvertMask | If 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. |
Implements CBitmapContext.
|
virtual |
Performs a masked bitmap block transfer of a window server bitmap.
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=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.
This function should be used in preference to the CFbsBitmap overload if the bitmap is to be used more than once, as it is a lot quicker.
Windows that store their redraw commands will only store drawing position and a handle to bitmaps that are drawn in it. The bitmap handle is just a pointer to the bitmap in the FBSERV heap. At some point later WSERV may need to draw that window again and it will just replay the stored commands including the draw bitmap. However, if the client has changed the content of the bitmap, WSERV will effectively draw a different bitmap when it replays the commands.
CBitmapContext::BitBltMasked()
| aPoint | A position for the top left corner of the bitmap. |
| aBitmap | A window server bitmap. |
| aSourceRect | A rectangle defining the piece of the bitmap to be drawn, with co-ordinates relative to the top left corner of the bitmap. |
| aMaskBitmap | A window server mask bitmap. |
| 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. |
(generated from Symbian Developer Library)
|
virtual |
Cancels any clipping rectangle.
Clipping thus reverts to the full device area, the default.
Implements CGraphicsContext.
|
virtual |
Cancels the current clipping region.
Implements CGraphicsContext.
|
virtual |
Clears the whole bitmap.
The cleared area is filled with the current brush colour.
This pure virtual function is implemented in derived classes.
Implements CBitmapContext.
|
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.
| aRect | The rectangle to clear. |
Implements CBitmapContext.
|
virtual |
Completes construction.
Panic condition: TW32Panic 17 in debug builds if called on an already constructed object. This function always causes a flush of the window server buffer.
(generated from Symbian Developer Library)
Copies a rectangle.
This pure virtual function is implemented in derived classes.
| aOffset | The offset from the top left corner of the rectangle to be copied to the top left corner of the copy. |
| aRect | The rectangular area to be copied. |
Implements CBitmapContext.
|
virtual |
Frees the graphics context to be used with another window.
This method should be called when the application has completed drawing to the window.
(generated from Symbian Developer Library)
|
virtual |
Gets a pointer to the graphics context's graphics device.
Implements CGraphicsContext.
|
virtual |
Discards a non-built-in brush pattern.
This frees up the memory used by the bitmap, if it is not being shared by another process.
Notes:
The brush is used for filling shapes and the background of text boxes. The brush has colour, style, pattern and pattern origin parameters.
If DiscardBrushPattern() is used, with no brush pattern set, then there is no effect.
Implements CGraphicsContext.
|
virtual |
Discards a font.
This frees up the memory used, if the font is not being shared.
The function can be called when no font is in use.
Implements CGraphicsContext.
|
virtual |
Draws an arc.
The arc is considered a portion of an ellipse. The ellipse is defined by the TRect argument.
The pixels at both the start point and the end point are drawn.
The arc itself is the segment of the ellipse drawn in an anti-clockwise direction from the start point to the end point.
Notes:
A rectangle is used in the construction of the ellipse of which the arc is a segment. This rectangle is passed as an argument of type TRect.
A wide line arc is drawn with the pixels distributed either side of a true ellipse, in such a way that the outer edge of the line would touch the edge of the construction rectangle. In other words, the ellipse used to construct it is slightly smaller than that for a single pixel line size.
If the specified start or end point is at the centre of the ellipse, then the line that defines the start or end of the arc defaults to one extending vertically above the centre point.
If the start and end point are the same point or are points on the same line through the ellipse centre then a complete unfilled ellipse is drawn.
| aRect | A rectangle in which to draw the ellipse, of which the arc is a segment. |
| aStart | The point defining the start of the arc. It defines one end of a line from the geometric centre of the ellipse. The point of intersection between this line and the ellipse defines the start point of the arc. |
| aEnd | The point defining the end of the arc. It defines one end of a second line from the geometric centre of the ellipse. The point of intersection between this line and the ellipse defines the end point of the arc. |
Implements CGraphicsContext.
|
virtual |
Draws a bitmap at the specified point.
The point specifies the top left hand corner of the bitmap. The bitmap is compressed or stretched based on its internally stored size in twips.
Notes:
This member function uses the bitmap's size in twips 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.
| aTopLeft | The point where the top left pixel of the bitmap is to be drawn |
| aSource | A source bitmap |
Implements CGraphicsContext.
|
virtual |
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.
| aDestRect | The rectangle within which the bitmap is to be drawn. |
| aSource | A source bitmap. |
Implements CGraphicsContext.
|
virtual |
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.
| aDestRect | The rectangle within which the bitmap is to be drawn. |
| aSource | A source bitmap. |
| aSourceRect | The rectangle in the source bitmap that is copied to the destination rectangle. |
Implements CGraphicsContext.
|
virtual |
Draws a specified rectangle of a source bitmap to fit into a given rectangle using a given mask.
Notes:
This member function uses rectangle sizes in pixels and does a stretch/compress blit using a linear DDA.
| aDestRect | The rectangle within which the bitmap is to be drawn. |
| aBitmap | The source bitmap |
| aSourceRect | The rectangle in the source bitmap that is to be drawn |
| aMaskBitmap | The mask to be applied to the source bitmap while drawing |
| aInvertMask | Flag to indicate if the mask should be inverted. |
Implements CGraphicsContext.
|
virtual |
Draws a specified rectangle from a wserv bitmap and its mask into another rectangle.
The function compresses/stretches the specified rectangle from the bitmap to fit the destination rectangle. 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=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: this member function uses rectangle sizes in pixels and does a stretch/compress blit using a linear DDA.
| aDestRect | The rectangle within which the masked bitmap is to be drawn. |
| aBitmap | A source wserv bitmap. |
| aSourceRect | The rectangle in the source bitmap that is copied to the destination rectangle. |
| aMaskBitmap | A mask wserv bitmap. |
| 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. |
Implements CGraphicsContext.
|
virtual |
Draws and fills an ellipse.
The ellipse is drawn inside the rectangle defined by the TRect argument. Any rectangle that has odd pixel dimensions, has the bottom right corner trimmed to give even pixel dimensions before the ellipse is constructed.
Note:
A wide outline ellipse is drawn with the pixels distributed either side of a true ellipse, in such a way that the outer edge of the line touches the edge of the construction rectangle. In other words, the ellipse used to construct it is smaller than that for a single pixel line size.
| aRect | The rectangle in which the ellipse is drawn. |
Implements CGraphicsContext.
|
virtual |
Draws a straight line between two points.
| aPoint1 | The point at the start of the line. |
| aPoint2 | The point at the end of the line. |
Implements CGraphicsContext.
|
virtual |
Draws a straight line relative to the current drawing point, using a vector.
The start point of the line is the current drawing point. The specified vector is added to the drawing point to give the end point of the line
| aVector | The vector to add to the current internal drawing position, giving the end point of the line. |
Implements CGraphicsContext.
|
virtual |
Draws a straight line from the current drawing point to a specified point.
| aPoint | The point at the end of the line. |
Implements CGraphicsContext.
|
virtual |
Draws and fills a pie slice.
The pie slice is an area bounded by:
the arc of an ellipse drawn in an anticlockwise direction from the start point to the end point
the straight line drawn to the start point from the geometric centre of the ellipse.
the straight line to the end point from the geometric centre of the ellipse.
Notes:
A rectangle is used in the construction of the pie slice. This rectangle is passed as an argument of type TRect. The curved edge of the pie slice is an arc of an ellipse constructed within the rectangle.
The line drawn by the pen goes inside the specified rectangle.
The pixels at the end point of the arc are not drawn.
A wide line edged pie slice has the arc drawn with the pixels distributed either side of a true ellipse. This is done in such a way that the outer edge of the line touches the edge of the construction rectangle. In other words, the ellipse used to construct it is slightly smaller than that for a single pixel line size.
If the specified start or end point is at the centre of the ellipse, then the line that defines the start or end of the arc defaults to one extending vertically above the centre point.
If the start and end point are the same point or are points on the same line through the ellipse centre then a complete filled ellipse is drawn. A line is also drawn from the edge to the ellipse centre.
| aRect | A rectangle in which to draw the ellipse bounding the pie slice. |
| aStart | A point defining the start of the arc bounding the pie slice. It defines one end of a line from the geometrical centre of the ellipse. The point of intersection between this line and the ellipse defines the start point of the arc. |
| aEnd | A point to define the end of the arc bounding the pie slice. It defines one end of a second line from the geometrical centre of the ellipse. The point of intersection between this line and the ellipse defines the end point of the arc. |
Implements CGraphicsContext.
|
virtual |
Draws and fills a polygon defined using an array of points.
The first point in the array defines the start of the first side of the polygon. The second point defines the second vertex (the end point of the first side and the start point of the second side).
The final side of the polygon is drawn using the last point from the array, and the line is drawn to the start point of the first side.
Self-crossing polygons are filled according to the specified fill rule.
| aPointList | An array of points, specifying the vertices of the polygon. |
| aFillRule | The fill rule. By default, this is TFillRule::EAlternate. |
Implements CGraphicsContext.
|
virtual |
Draws and fills a polygon defined using a list of points.
The first point in the list defines the start of the first side of the polygon. The second point defines the second vertex (the end point of the first side and the start point of the second side).
The final side of the polygon is drawn using the last point from the list, and the line is drawn to the start point of the first side.
Self-crossing polygons are filled according to the specified fill rule.
| aPointList | Pointer to list of points, specifying the vertices of the polygon. |
| aNumPoints | The number of points in the list. |
| aFillRule | The fill rule. By default this is TFillRule::EAlternate. |
Implements CGraphicsContext.
Draws a polyline from a set of points in an array.
A polyline is a series of concatenated straight lines joining a set of points.
| aPointList | An array containing the points on the polyline. |
Implements CGraphicsContext.
|
virtual |
Draws a polyline from a set of points in a list.
A polyline is a series of concatenated straight lines joining a set of points.
| aPointList | Pointer to a set of points on the polyline. |
| aNumPoints | Number of points in the list. |
Implements CGraphicsContext.
|
virtual |
Draws and fills a rectangle.
| aRect | The rectangle to be drawn. |
Implements CGraphicsContext.
|
virtual |
Draws and fills a rectangle with rounded corners.
The rounded corners are each constructed as an arc of an ellipse.
The line drawn by the pen, if any, goes inside the specified rectangle.
Notes:
Dotted and dashed pen styles cannot be used for the outline of a rounded rectangle.
If either corner size dimension is greater than half the corresponding rectangle length, the corner size dimension is reduced to half the rectangle size.
| aRect | The rectangle to be drawn. |
| aCornerSize | The dimensions of each corner. |
Implements CGraphicsContext.
Draws text without a surrounding box.
The text baseline is aligned with the y co-ordinate of the specified point, and the left end of the text is aligned with the x co-ordinate of the specified point.
Note:
Text drawing is done with the pen, and is subject to the pen colour. The effective text colour also depends on the drawing mode. The size and style of the text depends on the font used. The layout of the text depends on the justification mode set.
| aText | The text string to be drawn. |
| aPosition | A point specifying the position of the left end of the text. |
Implements CGraphicsContext.
|
virtual |
Draws text inside a box.
The surrounding box is filled with the current brush colour (not a pattern) and is drawn without any outline. The effective box colour depends on the drawing mode - if a brush colour has not been set then the brush defaults to white. The brush may be set to TBrushStyle::ENullBrush if text positioning relative to a box is required, but the box should not be filled.
The font used is that set by UseFont(). If no font is in use then a panic occurs.
The alignment of the text within the box can be specified.
Text drawn within a box is also clipped to that box. Unless you intend to clip the top off the text, aBaselineOffset should be greater than or equal to the ascent of the current font.
Offsets:
If the offset is negative, zero, or less than font height this is handled as would be expected, i.e. no text will be seen in the box in the first two instances, and the top of the text will be clipped in the latter case.
Margins:
For the drawing of right-aligned text, aLeftMargin indicates the margin from the right of aBox - where a positive value results in a leftwards offset.
Negative margins can be used to display portions of the text string clipped by the box. A negative margin for left aligned text would clip the start of the text string. Similarly, a negative margin for right aligned text would clip the end of the text string.
If the margin is greater than the width of the box then no text will be visible.
The margin is still honoured for centred text - centred text will not be centred in the box, unless the margin is zero.
Note:
Text drawing is done with the pen, and is thus subject to the pen colour. The effective text colour also depends on the drawing mode. The size and style of the text depends on the used font. The layout of the text depends on the justification mode set.
| aText | The text string to be drawn. |
| aBox | The box to draw the text in. |
| aBaselineOffset | An offset from the top of the box to the text baseline. |
| aAlignment | The text alignment mode default is left aligned. |
| aLeftMargin | The left margin for left-aligned text, or the right margin for right-aligned text default is zero. |
Implements CGraphicsContext.
|
virtual |
Draws vertical text in the specified direction.
| aText | The text to be drawn. |
| aPos | Point of origin of the text baseline. |
| aUp | Direction. ETrue for up, EFalse for down. |
Implements CGraphicsContext.
|
virtual |
Draws text vertically in the specified direction, within a box of the specified size.
| aText | The text to be drawn. |
| aBox | The bounding box within which the text should be drawn, and which it is clipped to. |
| aBaselineOffset | The height of the top of the characters from their text baseline. |
| aUp | The direction. ETrue for up, EFalse for down. |
| aVert | The text alignment. |
| aMargin | The margin. |
Implements CGraphicsContext.
|
virtual |
Draws an abstract artwork.
It does nothing if aDestRect values fall outside the window area.
| aId | the identifier for the artwork |
| aDestRect | the destination rect within the active window for this artwork |
(generated from Symbian Developer Library)
|
virtual |
Draws an abstract artwork.
It does nothing if aDestRect values fall outside the window area.
| aId | the identifier for the artwork |
| aDestRect | the destination rect within the active window for this artwork |
| aData | opaque datagram to associate with this occasion of drawing. The format is dependent upon the artwork |
(generated from Symbian Developer Library)
| IMPORT_C TAny * CWindowGc::Interface | ( | TUid | aInterfaceId | ) |
| IMPORT_C const TAny * CWindowGc::Interface | ( | TUid | aInterfaceId | ) | const |
|
virtual |
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.
| aRect | The rectangle in which pixels are to be mapped. |
| aColors | A pointer to a set of RGB pairs. |
| aNumPairs | The number of pairs |
| 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. |
Implements CGraphicsContext.
|
virtual |
Sets the drawing point relative to the current co-ordinates.
A subsequent call to DrawLineTo() or DrawLineBy() uses the new drawing point as the start point for the line drawn.
Notes
The operations DrawLine(), DrawLineTo(), DrawLineBy() and DrawPolyline() also change the internal drawing position to the last point of the drawn line(s).
The internal drawing position is set to the co-ordinate origin if no drawing or moving operations have yet taken place.
| aVector | The amount by which the internal drawing position is to move. |
Implements CGraphicsContext.
|
virtual |
Sets the drawing point 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.
Notes
The operations DrawLine(), DrawLineTo(), DrawLineBy() and DrawPolyline() also change the internal drawing position to the last point of the drawn line(s).
The internal drawing position is set to the co-ordinate origin if no drawing or moving operations have yet taken place.
| aPoint | The new internal drawing position. |
Implements CGraphicsContext.
|
virtual |
Draws a single point.
The point is drawn with the current pen settings using the current drawing mode.
Note:
If the pen size is greater than one pixel, a filled circle of the current pen colour is drawn, with the pen size as the diameter and the plotted point as the centre. If the pen size is an even number of pixels, the extra pixels are drawn below and to the right of the centre.
| aPoint | The point to be drawn. |
Implements CGraphicsContext.
|
virtual |
Resets the graphics context to its default settings:
the drawing mode is TDrawMode::EDrawModePen (pen and brush colours used as they are)
there is no clipping rectangle
the pen settings are: black, solid, single pixel size
the brush style is null
no text font is selected
Implements CGraphicsContext.
|
virtual |
Sets the brush colour.
The effective brush colour depends on the drawing mode.
Notes:
The brush is used for filling shapes and the background of text boxes. In case of outlined text, the brush is used for filling the font. The brush has colour, style, pattern and pattern origin parameters.
If no brush colour has been set, it defaults to white. However the default brush style is null, so when drawing to a window the default appears to be the window's background colour.
| aColor | An RGB colour for the brush. |
Implements CGraphicsContext.
|
virtual |
Sets the brush pattern origin.
This specifies the top left-hand corner position for the pattern tile around which copies of the pattern are tiled.
The brush pattern may be a built-in style, or a bitmap. To use a bitmap, the brush must have a pattern set and the brush style must be set to TBrushStyle::EPatternedBrush.
Notes
The brush is used for filling shapes and the background of text boxes. The brush has colour, style, pattern and pattern origin parameters.
If SetBrushOrigin() is not used, then the origin defaults to (0,0).
This brush origin remains in effect for all fillable shapes drawn subsequently, until a new brush origin is set. Shapes can thus be considered as windows onto a continuous pattern field (covering the whole clipping region of a screen device, or the whole device area of a printer).
| aOrigin | An origin point for the brush. The coordinates are relative to the rectangle to fill, i.e. specify 0,0 to align the pattern flush with the top and left hand sides of the rectangle. |
Implements CGraphicsContext.
|
virtual |
Sets the brush style.
Ten brush styles are provided, including six built-in hatching patterns. Note: The brush is used for filling shapes and the background of text boxes. The brush has colour, style, pattern and pattern origin parameters. Note: Use TBrushStyle::ENullBrush to draw the outline of a fillable shape on its own, without filling. Note: If the TBrushStyle::EPatternedBrush style is set, but no bitmap pattern has been selected using UseBrushPattern(), then the function panics. Note: Hatching lines are done in the current pen colour, set using SetPenColor(). The hatching pattern starts at the brush origin, set using SetBrushOrigin().
| aBrushStyle | A brush style. |
Implements CGraphicsContext.
|
virtual |
Sets character justification.
This function is required by the Text Views API, and is not intended for regular use by developers.
It affects the strings of text used in the calls to DrawText() that follow, until the number of characters drawn equals aNumChars.
The text line that is to be justified has a certain number of characters this includes the spaces between the words. It also has a distance (in pixels) between the end of the last word and the actual end of the line (right hand margin, usually). These excess width pixels are distributed amongst all the characters, increasing the gaps between them, to achieve full justification of the text line.
Use CFont::TextCount() to return the excess width.
Notes:
This function is provided to allow simulation of printer fonts on screen. Due to the fact that fully-scalable fonts are not used before v5, large printer fonts can be simulated by using the nearest smaller font and widening it slightly.
If the excess width is zero, then calling SetCharJustification() has no effect.
SetCharJustification() is required for WYSIWYG where the layout uses printer font metrics but screen fonts have to be drawn on the screen. Because continuously scalable typefaces (c.f. TrueType) are not used before v5 and because screen fonts are coarser and less numerous in their variety than the printer fonts, the best matching smaller screen font must be used with character justification to simulate the printer font on the screen.
There is also a situation where the gaps between characters on screen have to be reduced with character clipping. The screen font that best matches the printer font may have the required height, but has characters that are too wide. A line of text that works on the printer will then be too long on the screen, unless it is squashed horizontally. The number of pixels that overlap the end of the screen line must now be removed from the gaps between the characters, i.e. there is a negative excess width. This situation is especially important where adding a TAB on screen gives perfectly acceptable printout, but would push the last character of the line off the right hand side of the screen.
In practice what you do in printer layout mode is:
Calculate where the line breaks will come on the printer. To do this you use a printer font (which in practice means a table of character widths of the font that the printer will use).
Now change to use a screen font that is the closest font which is no taller that the printer font. In practice it will often be fatter maybe only for certain characters such as 'i'.
You have to recalculate the width of the characters using the screen fonts. You can do this using CFont::TextWidth() as you have already determined how many characters will fit on the line.
If, in the screen font, the characters are not as wide as the line then you can just use word justification to expand the line. You would only do this if the text is to be justified.
If, however, the characters are wider than the line then you would use character justification to clip each character. You would need to do this even if the line is not justified.
Thus, in practice, character justification will only very rarely be used to expand a line of characters.
| aExcessWidth | The excess width (in pixels) to be distributed between the specified number of characters. It may be positive, in which case the text is stretched, or negative, in which case it is shrunk. |
| aNumChars | The number of characters involved. |
Implements CGraphicsContext.
|
virtual |
Sets the clipping rectangle.
The area of visible drawing depends on the clipping rectangle, any items that fall outside the extent of the clipping rectangle will not be drawn. The default clipping rectangle is the full device area.
Note that clipping is additive. If a clipping region has been set using SetClippingRegion() then clipping will be to the intersection of that region and this rectangle.
| aRect | The rectangle to be used as the clipping rectangle. Note that this rectangle is tranformed by the current co-ordinate origin before it is used. The co-ordinate origin is set using SetOrigin(). |
Implements CGraphicsContext.
|
virtual |
Sets the clipping region, any items that fall outside the extent of the clipping region will not be drawn.
Note that clipping is additive. If a clipping rectangle has been set using SetClippingRect() then clipping will be to the intersection of that rectangle and this region.
| aRegion | The new clipping region. Note that clipping region co-ordinates are used as absolute co-ordinates, they are not transformed by the current co-ordinate origin before use (as occurs in SetClippingRect()). |
Implements CGraphicsContext.
|
virtual |
Sets the origin used for colour dithering.
| aPoint | New dither origin. |
(generated from Symbian Developer Library)
|
virtual |
Sets the drawing mode.
The way that the pen and brush draw depends on the drawing mode. The drawing mode 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. There are many drawing modes, each giving different logical combinations of pen, brush and screen colours. Each mode is produced by ORing together different combinations of seven drawing mode components.
The three most important modes are TDrawMode::EDrawModePEN, TDrawMode::EDrawModeNOTSCREEN and TDrawMode::EDrawModeXOR. The default drawing mode is TDrawMode::EDrawModePEN.
The drawing mode is over-ridden for line and shape drawing functions when a wide pen line has been selected. It is forced to TDrawMode::EDrawModePEN. This is to prevent undesired effects at line joins (vertexes).
Notes:
TDrawMode::EDrawModeAND gives a "colour filter" effect. For example:
TDrawMode::EDrawModeOR gives a "colour boost" effect. For example:
TDrawMode::EDrawModeXOR gives an "Exclusive OR" effect. For example:
TDrawMode::EDrawModeWriteAlpha should not normally need to be used by client code. The following are exceptions:-
Note that if you have a transparent brush or source bitmap and you are drawing to a window, then it is a defect to use EDrawModeWriteAlpha.
| aDrawingMode | The drawing mode. |
Implements CGraphicsContext.
|
virtual |
Sets whether the graphics context is faded.
| aFaded | ETrue to fade the GC; EFalse to unfade it. |
Implements CBitmapContext.
|
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).
| aBlackMap | Black map fading parameter. Unfaded this is 0. |
| aWhiteMap | White map fading parameter. Unfaded this is 255. |
Implements CBitmapContext.
|
virtual |
Sets and unsets an opaque flag on the window.
When drawing to a transparent window with the opaque flag set, drawing commands will not appear transparent. When drawing to a non-transparent window this command has no effect. The result of non-opaque drawing performed over the top of an area of the window to which opaque drawing has already been done is undefined. The result of opaque alpha blending or color mapping over the top of an area of the window to which opaque drawing has not already been done is undefined. This method is supported from version 8.1
| aDrawOpaque | If true, opaque mode is switched on. If false, normal drawing will be used. |
(generated from Symbian Developer Library)
Sets the position of the co-ordinate origin.
All subsequent drawing operations are done relative to this origin.
| aPos | The origin. The default origin is TPoint(0,0) the top left corner of the screen. |
Implements CGraphicsContext.
|
virtual |
Sets the pen colour.
The effective pen colour depends on the drawing mode. The default pen colour is black.
Note:
The pen is used to draw lines, the outlines of filled shapes, and text. In case of outlined text, the pen is used to draw the outline of the font.
The class provides member functions to set the colour of the pen, the style of line and the line size drawn.
| aColor | An RGB colour for the pen. |
Implements CGraphicsContext.
|
virtual |
Sets the line drawing size for the pen.
Lines of size greater than one pixel:
are drawn with rounded ends that extend beyond the end points, (as if the line is drawn using a circular pen tip of the specified size).
are always drawn in TDrawMode::EDrawModePEN mode, overriding whatever mode has been set using SetDrawMode().
Notes:
The pen is used to draw lines, the outlines of filled shapes, and text. The class provides member functions to set the colour of the pen, the style of line and the line size drawn.
Wide straight lines and arcs have rounded ends so that concatenated wide lines have smoothly rounded corners at the vertexes.
When lines are made wide, the extra strips of pixels are added equally to both sides of the line. This works precisely for lines of odd pixel size (3, 5, 7, etc.). Wide lines of even pixel size, (2, 4, 6, etc.), have the extra strip of pixels added to the right and/or below the line.
Wide outlines of ellipses and wide line arcs are drawn with the pixels distributed either side of a thin (single pixel wide) true ellipse constructed in the normal manner. Wide ellipses and arcs of even pixel size have the extra strip of pixels added to the right and/or below the curved line. This gives a slight asymmetry to ellipses.
If the pen style is dotted or dashed, the size specification is ignored: a single-pixel wide primitive is drawn, (this is device dependant).
A line size of zero is handled as if the pen style had been set to TPenStyle::ENullPen.
| aSize | A line size. The default is 1 pixel. |
Implements CGraphicsContext.
|
virtual |
Sets the line drawing style for the pen.
There are 6 pen styles. If no pen style is set, then the default is TPenStyle::ESolidPen. To use a pen style, its full context must be given, e.g. for a null pen:
CGraphicsContext::TPenStyle::ENullPen Notes:
The pen is used to draw lines, the outlines of filled shapes, and text. CGraphicsContext member functions are provided to set the colour of the pen, the style of line and the line size drawn.
The TPenStyle::ENullPen style should be used if a border is not required around a filled shape.
Dotted and dashed pen styles have a device dependant implementation, always give single-pixel size lines on the screen whatever the pen size set by SetPenSize() and can only be used for straight lines, polylines, non-rounded rectangles and polygons.
The dotted/dashed pattern is continued, without re-starting, for all consecutively drawn straight lines, i.e.
the outlines of rectangles the pattern starts in the top left corner. It is reset at the end of the function call.
the outlines of polygons the pattern starts at the first point. It is reset at the end of the function call.
polylines and straight lines the pattern starts at the first point initially. Consecutive calls to DrawLine() and/or DrawPolyLine(), whether the lines are concatenated or not, continue the pattern. It can be reset by a further call to SetPenStyle() using the same dotted/dashed style parameter.
| aPenStyle | A pen style. |
Implements CGraphicsContext.
|
virtual |
Sets the strikethrough style.
This is applied to all subsequently drawn text.
| aStrikethroughStyle | The strikethrough style on or off. |
Implements CGraphicsContext.
|
virtual |
Sets the underline style.
This is applied to all subsequently drawn text.
| aUnderlineStyle | The underline style on or off. |
Implements CGraphicsContext.
|
virtual |
Adjusts the spaces between words to stretch or squeeze to a certain width.
The function is required by the Text Views API, and is not intended for regular use by developers.
The text line that is to be justified has a certain number of gaps (spaces) between the words. It also has a distance (in pixels) between the end of the last word and the actual end of the line (right hand margin, usually). These excess width pixels are distributed amongst the gaps between the words to achieve full justification of the text line. Spaces become fat spaces to keep underlining/strikethrough consistent. Pixels are distributed to the inter-word gaps starting from the left end of the string. The spacing between characters in each word remains unchanged.
After a call to SetWordJustification(), subsequent calls to either of the two DrawText() functions are affected until the number of spaces specified by aNumSpaces is used up.
The easiest way to find out the excess width and number of spaces is to call CFont::MeasureText(). This function can also perform counting, which is finding how much of some text will fit into a given width.
Use CFont::TextCount() to return the excess width.
For example, in the string "To be, or not to be", there are five inter-word gaps. If there are six excess pixels they will be distributed in the proportion 2, 1, 1, 1, 1 between the words. If there are nine excess pixels they will be distributed in the proportion 2, 2, 2, 2, 1 between the words.
Notes:
If the excess width is zero, then calling SetWordJustification() has no effect.
At first sight it may appear that SetWordJustification() is not required because you can simply call DrawText() for each word. However, underlined justified text does not work using this strategy you get a non-underlined gap between the space and the beginning of the next word.
| aExcessWidth | The width (in pixels) to be distributed between the specified number of spaces. |
| aNumGaps | The number of word spaces (characters with the code U+0020) over which the change in width is distributed. |
Implements CGraphicsContext.
|
virtual |
Sets the brush pattern to the specified bitmap.
For the brush to actually use the bitmap, TBrushStyle::EPatternedBrush must be used to set the brush style.
When the brush pattern is no longer required, use DiscardBrushPattern() to free up the memory used, if the bitmap is not being shared. If UseBrushPattern() is used again without using DiscardBrushPattern() then the previous pattern is discarded automatically.
Notes:
The brush is used for filling shapes and the background of text boxes. The brush has colour, style, pattern and pattern origin parameters.
When loading a bitmap, the bitmap is checked to see if it is already in memory. If the bitmap is already there, then that copy is shared.
The brush does not need to have a pattern set at all. There are several built-in hatching patterns which can be selected using SetBrushStyle().
| aBitmap | A bitmap pattern for the brush. |
Implements CGraphicsContext.
|
virtual |
Sets the device font to be used for text drawing.
If the font is already in memory, then that copy is shared.
Notes:
The CFont* argument must have been previously initialised by calling MGraphicsDeviceMap::GetNearestFontInTwips() with the required font-specification. If the CFont* has not been initialised correctly, and therefore does not point to an available font-bitmap, then a panic is raised.
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 is raised.
| aFont | A device font |
Implements CGraphicsContext.
|
friend |