A class representing the state of a PCanvas.
![]() | PCanvasState () Create a new canvas state with default values. |
![]() | PCanvasState ( const PCanvasState & s ) Create a copy of the canvas state. |
![]() | SetPenStyle ( PenStyles style ) Set the pen style to be used by future drawing operations. |
![]() | GetPenStyle () const Get the pen style to be used by future drawing operations. |
![]() | SetPenWidth ( int width ) Set the pen width to be used by future drawing operations. |
![]() | GetPenWidth () const Get the pen width to be used by future drawing operations. |
![]() | SetPenMode ( DrawingModes mode ) Set the pen mode to be used by future drawing operations. |
![]() | GetPenMode () const Get the pen mode to be used by future drawing operations. |
![]() | SetPenFgColour ( const PColour & colour ) Set the pen foreground colour to be used by future drawing operations. |
![]() | GetPenFgColour () const Get the pen foreground colour to be used by future drawing operations. |
![]() | SetPenBkColour ( const PColour & colour ) Set the pen background colour to be used by future drawing operations. |
![]() | GetPenBkColour () const Get the pen background colour to be used by future drawing operations. |
![]() | SetFillPattern ( const PPattern & pattern ) Set the fill pattern to be used by future drawing operations. |
![]() | GetFillPattern () const Get the fill pattern to be used by future drawing operations. |
![]() | SetPatternOrigin ( const PPoint & pt ) Set the origin for the pattern. |
![]() | GetPatternOrigin () const Get the origin for the pattern. |
![]() | SetFillMode (DrawingModes style) Set the fill mode to be used by future drawing operations. |
![]() | GetFillMode () const Get the fill mode to be used by future drawing operations. |
![]() | SetFillFgColour ( const PColour & colour ) Set the fill foreground colour to be used by future drawing operations. |
![]() | GetFillFgColour () const Get the fill foreground colour to be used by future drawing operations. |
![]() | SetFillBkColour ( const PColour & colour ) Set the fill background colour to be used by future drawing operations. |
![]() | GetFillBkColour () const Get the fill background colour to be used by future drawing operations. |
![]() | SetFont (const PFont & newFont) Set the font drawing tool to be used by future drawing operations. |
![]() | GetFont () const Get the font drawing tool that is used by drawing operations. |
![]() | SetTextFgColour ( const PColour & colour ) Set the text foreground colour to be used by future drawing operations. |
![]() | GetTextFgColour () const Get the text foreground colour to be used by future drawing operations. |
![]() | SetTextBkColour ( const PColour & colour ) Set the text background colour to be used by future drawing operations. |
![]() | GetTextBkColour () const Get the text background colour to be used by future drawing operations. |
![]() | SetPolyFillMode ( PolyFillMode newMode ) Set the polygon fill mode to be used by future drawing operations. |
![]() | GetPolyFillMode () const Get the polygon fill mode to be used by future drawing operations. |
![]() | SetPalette ( const PPalette & newPal ) Set the colour palette to be used by future drawing operations. |
![]() | GetPalette () const Get the colour palette to be used by future drawing operations. |
![]() | SetMappingRect ( const PRect & rect ) Set the source rectangle to be used in the coordinate transform in future drawing operations. |
![]() | GetMappingRect () const Get the source rectangle that is used in the coordinate transform of drawing operations. |
![]() | SetViewportRect ( const PRect & rect ) Set the destination rectangle to be used in the coordinate transform in future drawing operations. |
![]() | GetViewportRect () const Get the destination rectangle that is used in the coordinate transform of drawing operations. |
![]() | SetOrigin (const PPoint & pt) Set the origin of the user coordinate system. |
![]() | GetOrigin () const Set the origin of the user coordinate system. |
![]() | New functions for class |
A class representing the state of a PCanvas. The state of a canvas is the current font, colours, line & fill modes etc that describes the way in which drawing operations are performed. Note that this class is not descended from the standard PObject class as multiple inheritance is used and common ancestors should be avoided at all costs.
If the logical modes, eg SrcAndDst, are used on a colour canvas then
the boolean states for source and destination are derived by comparing
the colour to the current drawing foreground colour.
When the fill mode is Alternating, the area between odd-numbered and
even-numbered polygon sides on each scan line is filled. That is, the
area between the first and second side, between the third and fourth
side, and so on is filled. When the fill mode is Winding, any region that has a nonzero winding
value is filled. This value is defined as the number of times a pen
used to draw the polygon would go around the region. The direction of
each edge of the polygon is important.
The mapping rectangle (in user coordinates) is transformed into the
viewport rectangle (in device coordinates). This provides a scaling
factor as well as origin shifting.
The mapping rectangle (in user coordinates) is transformed into the
viewport rectangle (in device coordinates). This provides a scaling
factor as well as origin shifting.
The mapping rectangle (in user coordinates) is transformed into the
viewport rectangle (in device coordinates). This provides a scaling
factor as well as origin shifting.
The mapping rectangle (in user coordinates) is transformed into the
viewport rectangle (in device coordinates). This provides a scaling
factor as well as origin shifting.
PCanvasState( const PCanvasState & s )
New functions for class
enum PenStyles
Solid
Dotted
virtual BOOL SetPenStyle( PenStyles style )
PenStyles GetPenStyle() const
virtual BOOL SetPenWidth( int width )
int GetPenWidth() const
enum DrawingModes
SrcCopy
SrcInvert
SrcAndDst
NotSrcAndDst
SrcAndNotDst
InvertSrcAndDst
SrcOrDst
NotSrcOrDst
SrcOrNotDst
InvertSrcOrDst
SrcXorDst
InvertSrcXorDst
virtual BOOL SetPenMode( DrawingModes mode )
DrawingModes GetPenMode() const
virtual BOOL SetPenFgColour( const PColour & colour )
const PColour& GetPenFgColour() const
virtual BOOL SetPenBkColour( const PColour & colour )
const PColour& GetPenBkColour() const
virtual BOOL SetFillPattern( const PPattern & pattern )
PPattern GetFillPattern() const
virtual BOOL SetPatternOrigin( const PPoint & pt )
PPoint GetPatternOrigin() const
virtual BOOL SetFillMode(DrawingModes style)
DrawingModes GetFillMode() const
virtual BOOL SetFillFgColour( const PColour & colour )
const PColour& GetFillFgColour() const
virtual BOOL SetFillBkColour( const PColour & colour )
const PColour& GetFillBkColour() const
virtual BOOL SetFont(const PFont & newFont)
PFont GetFont() const
virtual BOOL SetTextFgColour( const PColour & colour )
const PColour& GetTextFgColour() const
virtual BOOL SetTextBkColour( const PColour & colour )
const PColour& GetTextBkColour() const
enum PolyFillMode
Winding
Alternating
virtual BOOL SetPolyFillMode( PolyFillMode newMode )
PolyFillMode GetPolyFillMode() const
virtual BOOL SetPalette( const PPalette & newPal )
PPalette GetPalette() const
virtual BOOL SetMappingRect( const PRect & rect )
PRect GetMappingRect() const
virtual BOOL SetViewportRect( const PRect & rect )
PRect GetViewportRect() const
void SetOrigin(const PPoint & pt)
PPoint GetOrigin() const
Alphabetic index HTML hierarchy of classes or Java