Inheritance diagram for CP_Graphics:
Public Member Functions | |
Constructor / Destructor | |
CP_Graphics (CP_Canvas &inDestCanvas, bool inSynchronizeWithPort=true, CP_E_GraphicsImp inImpClassType=CP_E_GraphicsImp_PlatformNative) | |
Constructor. | |
virtual | ~CP_Graphics () |
Destructor. | |
Implementor | |
CP_Graphics_Imp * | GetImpClass () |
void | SetImpClass (CP_Graphics_Imp *inImpClass) |
Getters | |
float | GetLineWidth () |
float | GetAlpha () |
CP_ARGBColor | GetStrokeColor () |
CP_ARGBColor | GetFillColor () |
State | |
void | SaveState () |
void | RestoreState () |
void | ScaleCTM (float inHorAmt, float inVerAmt) |
void | RotateCTM (float inAngle) |
void | SkewCTM (float inHorAmt, float inVerAmt) |
Arcs | |
void | StrokeArc (float inHorCenter, float inVerCenter, float inRadius, float inStartAngle, float inEndAngle) |
void | FillArc (float inHorCenter, float inVerCenter, float inRadius, float inStartAngle, float inEndAngle) |
Bezier Curves | |
void | StrokeBezier (const CP_Point &inStartPoint, const CP_Point &inControlPointOne, const CP_Point &inControlPointTwo, const CP_Point &inEndPoint) |
void | StrokeQuadBezier (const CP_Point &inStartPoint, const CP_Point &inControlPointOne, const CP_Point &inEndPoint) |
Gradient | |
void | DrawGradient (CP_E_GradientType inGradietType, CP_Rect &inDestBounds) |
void | SetGradientAngle (SInt16 inAngle) |
void | SetGradientColor (const SInt16 inIndex, const CP_ARGBColor &inColour) |
void | SetGradientCount (SInt16 inGradientCount) |
Lines | |
void | Line (const CP_Point &inStartPoint, const CP_Point &inEndPoint) |
void | Line (float inStartHorLocation, float inStartVerLocation, float inEndHorLocation, float inEndVerLocation) |
Icons | |
void | DrawIcon (const CP_Rect &inBounds, CP_E_IconStyle inIconType, SInt16 inIconID) |
void | DrawIcon (CP_OSIcon &inPicture, const CP_Rect &inBounds) |
Images | |
void | DrawImage (SInt16 inImageResID, CP_Rect &inDestBounds) |
void | DrawImage (const CP_FileSystemSpec &inImageSpec, CP_Rect &inDestBounds) |
void | DrawImage (const CP_FileSystemSpec &inImageSpec, CP_Rect &inSrcBounds, CP_Rect &inDestBounds) |
void | DrawPicture (CP_OSPicture &inPicture, const CP_Rect &inBounds) |
Paths | |
void | BeginPath () |
void | ClosePath () |
void | StrokePath () |
void | FillPath () |
void | FillPath (CP_Pattern &inPattern) |
void | DrawPath (CP_E_PathDrawingMode inPathDrawMode) |
void | PathMoveTo (const CP_Point &inPoint) |
void | PathMoveTo (float inHorLocation, float inVerLocation) |
void | PathAddLineTo (const CP_Point &inPoint) |
void | PathAddLine (const CP_Point &inStartPoint, const CP_Point &inEndPoint) |
void | PathAddLine (float inStartH, float inStartV, float inEndH, float inEndV) |
void | PathAddLines (const CP_Point inPoint[], SInt16 inNumberPoints) |
void | PathAddRect (const CP_Rect &inBounds) |
void | PathAddOval (const CP_Rect &inBounds) |
void | PathAddBezier (const CP_Point &inStartPoint, const CP_Point &inControlPointOne, const CP_Point &inControlPointTwo, const CP_Point &inEndPoint) |
void | PathAddQuadBezier (const CP_Point &inStartPoint, const CP_Point &inControlPointOne, const CP_Point &inEndPoint) |
void | PathAddPoly (CP_Point_Array &inPoints) |
void | PathAddArc (float inHorCenter, float inVerCenter, float inRadius, float inStartAngle, float inEndAngle, SInt16 inClockwise) |
void | ClipPath () |
Polygons | |
void | StrokePoly (CP_Point_Array &inPoints) |
void | FillPoly (CP_Point_Array &inPoints) |
Rects | |
void | StrokeRect (const CP_Rect &inBounds) |
void | EraseRect (const CP_Rect &inBounds) |
void | FillRect (const CP_Rect &inBounds) |
Regions | |
void | StrokeRegion (const CP_Region &inRegion) |
void | FillRegion (const CP_Region &inRegion) |
Round Rects | |
void | StrokeRoundRect (const CP_Rect &inBounds, SInt16 inHorRadius, SInt16 inVerRadius) |
void | FillRoundRect (const CP_Rect &inBounds, SInt16 inHorRadius, SInt16 inVerRadius) |
Oval / Circle | |
void | StrokeOval (const CP_Rect &inBounds) |
void | FillOval (const CP_Rect &inBounds) |
Setters | |
void | SetAlpha (float inAlpha) |
void | SetLineWidth (float lineWidth) |
void | SetLineJoin (CP_E_GraphicsLineJoin inLineJoin) |
void | SetLineCap (CP_E_GraphicsLineCap inLineCap) |
void | SetStrokeColor (CP_ARGBColor &inStrokeColor) |
void | SetFillColor (CP_ARGBColor &inFillColor) |
Text | |
void | SetTextRenderingFlags (SInt16 inFlags) |
void | DrawString (CP_FontSpec &inFontSpec, const CP_String &inText, const CP_Point &inStartPoint) |
void | DrawText (CP_FontSpec &inFontSpec, const CP_String &inText, const CP_Rect &inBounds, SInt16 inHorAlign=CP_E_TextAlign_HorLeft, SInt16 inVerAlign=CP_E_TextAlign_VerTop, bool inWrapText=true) |
void | DrawTrunc (CP_FontSpec &inFontSpec, const CP_String &inText, const CP_Rect &inBounds, SInt16 inHorAlign=CP_E_TextAlign_HorLeft, SInt16 inVerAlign=CP_E_TextAlign_VerTop) |
Protected Attributes | |
CP_Graphics_Imp * | fImpClass |
CP_E_GraphicsImp | fImpClassType |
|
Constructor.
|
|
Destructor.
|
|
Returns implementation object that is doing the actual work of this class.
|
|
Sets the implementation object that is doing the actual work of this class.
|
|
Returns the current width used in drawing lines.
|
|
Returns the current alpha value used when drawing.
|
|
Returns the current color used in stroking.
|
|
Returns the current color used in filling.
|
|
Saves the current graphics state.
|
|
Restore the current graphics state. Each RestoreState needs to have a matching SaveState called before calling this.
CP_Graphics graphics( inDestCanvas ); graphics.SaveState(); do some drawing and state changes here, such as setting colors, line styles graphics.RestoreState();
|
|
Sets the scaling amount to be used in the current transformation matrix.
|
|
Sets the rotation amount to be used in the current transformation matrix.
|
|
Sets the skewing amount to be used in the current transformation matrix.
|
|
Draws an arc using the passed in parameters, and then strokes it, using the current stroke color and stroke line width.
|
|
Draws an arc using the passed in parameters, and then fills it, using the current fill color.
|
|
Draws a Bezier curve using the passed in parameters, and then strokes it, using the current stroke color and stroke line width.
|
|
Draws a Quad Bezier curve using the passed in parameters, and then strokes it, using the current stroke color and stroke line width.
|
|
Draws a gradient in the specified bounds. The gradient can be of the following types:
|
|
Sets the angle used to draw the gradient.
|
|
Sets one of the colors used to draw the gradient.
|
|
Sets the count of the number of colors used in drawing a gradient.
|
|
Draws a line from inStartPoint to inEndPoint
|
|
Draws a line from the passed in start location to the ending location.
|
|
Draws a icon resource in the passed in bounds. The image will be scaled to fit the rectangle.
|
|
Draws the CP_OSicon in the passed in bounds. The image will be scaled to fit the rectangle.
|
|
Draws a picture image into the specified area. The image will be scaled to fit into the destination area.
|
|
Draws a picture image into the specified area. The image will be scaled to fit into the destination area. The image is located in the passed in file spec.
|
|
Draw the passed in image object in the destination bounds, scaling the image to fit. This versions copies inSourceBounds portion of the image to the destination.
|
|
Draw the passed in OSPicture in the destination bounds, scaling the image as needed to fit.
|
|
Marks the beginning of a path. This indicates that all subsequent drawing operations until ClosePath is called is collected into the current path. After ClosePath is called, you can then stroke or fill the path. The only drawing calls that are added, are the ones that begin with Path, such as PathMoveTo, PathAddOval, PathAddRect, etc.
CP_Graphics graphics( inDestCanvas ); graphics.BeginPath(); do some path drawing commands here graphics.EndPath(); graphics.StrokePath();
|
|
Closes the current path. Every call to ClosePath needs to have a corresponding BeginPath call.
|
|
Strokes the current path.
|
|
Fills the current path.
|
|
Fills the current path with the passed in pattern.
|
|
Draws the current path using the passed in path drawing mode, which can be one of the following:
|
|
Sets the current point in the path to that of the passed in point. This is the location where subsequent drawing operations will begin unless the call specifies a new starting point in its params.
|
|
Sets the current point in the path to that of the passed in coordinates. This is the location where subsequent drawing operations will begin unless the call specifies a new starting point in its params.
|
|
Adds a line to our path. The line will be drawn from the current point to the location specified in inPoint.
|
|
Adds a starting and ending point to the current path.
|
|
Adds a line to the current path using the specified coordinates.
|
|
Add inNumberPoints lines to our path. The first point is the starting point, then each additional point has a line drawn from the last point to that point.
|
|
Adds a rect to the current path.
|
|
Adds an oval to the current path.
|
|
Adds a bezier curve to the current path.
|
|
Adds a quadratic bezier curve to the current path.
|
|
Adds a polygon to the current path as specified in the passed in points array.
|
|
Add an arc of a circle to the context's path, possibly preceded by a straight line segment. `(inHorCenter, inVerCenter)' is the center of the arc; `inRadius' is its radius; `inStartAngle' is the angle to the first endpoint of the arc; `inEndAngle' is the angle to the second endpoint of the arc; and `inClockwise' is 1 if the arc is to be drawn clockwise, 0 otherwise. `inStartAngle' and `inEndAngle' are measured in radians.
|
|
Sets the clipping path of the canvas being drawn into to that of the current path.
|
|
Draws the polygon specified by the passed in points array, then strokes it.
|
|
Draws the polygon specified by the passed in points array, and fills it.
|
|
Draws a rect specified by the passed in bounds, then strokes it.
|
|
Erases the passed in rect using the canvases current background color.
|
|
Draws a rect specified by the passed in bounds, then fills it.
|
|
Draws a region specified by the passed in region, then strokes it.
|
|
Draws a region specified by the passed in region, then fills it.
|
|
Draws a rounded rect specified by the passed in rect, then strokes it.
|
|
Draws a rounded rect specified by the passed in rect, then fills it.
|
|
Draws an oval specified by the passed in rect, then strokes it.
|
|
Draws an oval specified by the passed in rect, then fills it.
|
|
Sets the alpha value used when drawing.
|
|
Sets the line width used in stroking.
|
|
Sets the line join for determing how lines will be drawn when they join. Note: Some platforms do not support line join, and they will be drawn in the normal style. Current values for inLineJoint can be:
|
|
Sets the line cap for determing how lines ending will be drawn. Note: Some platforms do not support line caps, and they will be drawn in the normal style. Current values for inLineCap can be:
|
|
Sets the color used in stroking objects.
|
|
Sets the color used in filling objects.
|
|
Sets a flag to indicate how the text will be drawn in the destination canvas, if the platform supports them. Such as transparent or opaque.
|
|
Draws the passed in text at the locatio specified. The text will not be wrapped.
|
|
Draws the passed in text at the location specified. The text will be wrapped to fit in the passed in bounds.
|
|
Draws the passed in text at the locatio specified. The text will be truncated to fit in the passed in bounds.
|
|
|
|
The object that is implementing these functions. |