class PMemoryCanvas: public PCanvas

A drawable area that will go to a PImage in memory.

Inheritance:


Public Methods

[more] PMemoryCanvas ( const PImage & img )
Create a canvas using the specified image.
[more]virtual ~PMemoryCanvas ()
Destroy the canvas and image.
[more]virtual PRect GetDrawingBounds () const
Get the drawable area of the image, for instance, this would be the dimensions of the PPixelImage used by the canvas.
[more]const PImage GetImage ()
Get the image created by the canvas.

Public

[more] Overrides from class PCanvas
[more] New functions for class

Protected Fields

[more]PImage image
Image to draw into.


Inherited from PCanvas:

Public Classes

oenum DrawStringOptions

Public Methods

ovirtual Comparison Compare( const PObject & obj ) const
ovirtual PCanvasState& operator=( const PCanvasState & state )
oconst PRealFont& GetFont() const
ovirtual PFontFamilyList GetAvailableFonts() const
ovirtual void Save()
ovirtual void Restore()
ovirtual void SetCurrentPosition( PORDINATE x, PORDINATE y )
ovirtual void MoveCurrentPosition( PORDINATE x, PORDINATE y )
ovirtual void MoveCurrentPosition( const PPoint & pos )
ovirtual PPoint GetCurrentPosition() const
ovirtual void DrawLine( PORDINATE x, PORDINATE y )
ovirtual void DrawLine( const PPoint & pt )
ovirtual void DrawLineRelative( PORDINATE x, PORDINATE y )
ovirtual void DrawLine( PORDINATE x1, PORDINATE y1, PORDINATE x2, PORDINATE y2 )
ovoid DrawRect( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height )
ovoid FillRect( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height )
ovirtual void DrawFocusRect( const PRect & rect )
ovirtual void DrawBevelledRect( const PRect & rect, BOOL raised, BOOL deep )
ovirtual void DrawRoundRect( const PRect & rect, PDIMENSION cornerWidth, PDIMENSION cornerHeight )
ovirtual void DrawEllipse( const PRect & rect )
ovirtual void DrawArc( const PRect & rect, int startAngle, int endAngle )
ovirtual void DrawPie( const PRect & rect, int startAngle, int endAngle )
ovirtual void DrawChord( const PRect & rect, int startAngle, int endAngle )
ovirtual void DrawPolyLine( const PPointArray & ptArray )
ovirtual void DrawPolygon( const PPointArray & ptArray )
ovirtual void DrawImgIcon( PORDINATE x, PORDINATE y, const PImgIcon & icn )
ovirtual void DrawIcon( PORDINATE x, PORDINATE y, const PIcon & icn )
ovirtual void DrawPixels( PORDINATE x, PORDINATE y, const PPixelImage & pix )
ovirtual void DrawPixels( const PRect & rect, const PPixelImage & pix )
ovirtual void DrawPict( PORDINATE x, PORDINATE y, const PPictImage & pic )
ovirtual void DrawPict( const PRect & rect, const PPictImage & pic )
ovirtual void DrawString( PORDINATE x, PORDINATE y, const PString & str, int options = LeftAlign )
ovirtual PDIMENSION DrawString( const PRect & rect, const PString & str, int options = LeftAlign )
ovirtual PDim MeasureString( const PString & str )
ovirtual PDIMENSION MeasureString(const PString & str, PDIMENSION width)
ovirtual void DrawTextLine( PORDINATE x, PORDINATE y, const char * textChars, const PDIMENSION * charWidths, PINDEX len )
ovirtual PRect GetPhysicalBounds(BOOL inPixels = FALSE) const
ovirtual void SetClipRegion( const PRegion & rgn )
ovirtual PRegion GetClipRegion() const
ovirtual void SetClipRect( const PRect & rect )
ovirtual PRect GetClipRect() const
oBOOL IsInClipRegion( const PPoint & pt ) const
oPDIMENSION FromPixelsDX( PDIMENSION dx ) const
oPDIMENSION ToPixelsDX( PDIMENSION dx ) const
oPDIMENSION FromPointsX( PDIMENSION dx )
oPDIMENSION ToPointsX( PDIMENSION dx )

Protected Classes

oclass State: public PObject, public PCanvasState

Protected Fields

oPRealFont realFont

Protected Methods

ovirtual void _DrawRect( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height )
ovirtual void _FillRect( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height )

Protected

PORDINATE Member variables


Inherited from PObject:

Public

Run Time Type functions

Comparison functions

I/O functions

Miscellaneous functions


Inherited from PCanvasState:

Public Classes

oenum PenStyles
oenum DrawingModes
oenum PolyFillMode

Public Methods

ovirtual BOOL SetPenStyle( PenStyles style )
oPenStyles GetPenStyle() const
ovirtual BOOL SetPenWidth( int width )
oint GetPenWidth() const
ovirtual BOOL SetPenMode( DrawingModes mode )
oDrawingModes GetPenMode() const
ovirtual BOOL SetPenFgColour( const PColour & colour )
oconst PColour& GetPenFgColour() const
ovirtual BOOL SetPenBkColour( const PColour & colour )
oconst PColour& GetPenBkColour() const
ovirtual BOOL SetFillPattern( const PPattern & pattern )
oPPattern GetFillPattern() const
ovirtual BOOL SetPatternOrigin( const PPoint & pt )
oPPoint GetPatternOrigin() const
ovirtual BOOL SetFillMode(DrawingModes style)
oDrawingModes GetFillMode() const
ovirtual BOOL SetFillFgColour( const PColour & colour )
oconst PColour& GetFillFgColour() const
ovirtual BOOL SetFillBkColour( const PColour & colour )
oconst PColour& GetFillBkColour() const
ovirtual BOOL SetFont(const PFont & newFont)
ovirtual BOOL SetTextFgColour( const PColour & colour )
oconst PColour& GetTextFgColour() const
ovirtual BOOL SetTextBkColour( const PColour & colour )
oconst PColour& GetTextBkColour() const
ovirtual BOOL SetPolyFillMode( PolyFillMode newMode )
oPolyFillMode GetPolyFillMode() const
ovirtual BOOL SetPalette( const PPalette & newPal )
oPPalette GetPalette() const
ovirtual BOOL SetMappingRect( const PRect & rect )
oPRect GetMappingRect() const
ovirtual BOOL SetViewportRect( const PRect & rect )
oPRect GetViewportRect() const
ovoid SetOrigin(const PPoint & pt)
oPPoint GetOrigin() const


Documentation

A drawable area that will go to a PImage in memory. Note that the PImage object passed to the PMemoryCanvas is undefined while the PMemoryCanvas exists. Not until the PMemoryCanvas is destroyed is the PImage object guarenteed to be updated.

NOTE *********************************** On Some platforms, canvases are a limited resource. Do NOT create and leave them around for long periods. As soon as it is not required till the next user event, destroy it!

o PMemoryCanvas( const PImage & img )
Create a canvas using the specified image. The image will receive the drawing operations made to the canvas. The two types of images, PPixelImage and PPictImage will store the commands differently according to their internal representation of an image.
Parameters:
img - Image to draw into.

ovirtual ~PMemoryCanvas()
Destroy the canvas and image.

o Overrides from class PCanvas

ovirtual PRect GetDrawingBounds() const
Get the drawable area of the image, for instance, this would be the dimensions of the PPixelImage used by the canvas.

Returns:
rectangle for the maximum size of the drawable area.

o New functions for class

oconst PImage GetImage()
Get the image created by the canvas. While this will allow you to obtain a reference to the image instance being drawn to by the canvas, the state of the image is indeterminate while the PMemoryCanvas instance still exists. For example in X windows when a PPixelImage is being created, the pixels are not tranferred from the X server to the client until the PMemoryCanvas is destroyed.

oPImage image
Image to draw into.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.