iOS Guides | Samples

CoreGraphics.CGContext: Method Members

The methods of CoreGraphics.CGContext are listed below. For a list of all members, see the CGContext list.

See Also: Object

Public Methods

AddArc(nfloat, nfloat, nfloat, nfloat, nfloat, Boolean)
AddArcToPoint(nfloat, nfloat, nfloat, nfloat, nfloat)
Adds an arc to the current path.
AddCurveToPoint(nfloat, nfloat, nfloat, nfloat, nfloat, nfloat)
Adds a cubic Bézier curve at the current point, with the specified control parameters.
AddEllipseInRect(CGRect)
Adds an ellipse that fits in the specified rect.
AddLines(CGPoint[])
Adds the given lines to the current path.
AddLineToPoint(nfloat, nfloat)
Appends a line from the current point (see CGContext.GetPathCurrentPoint) to the specified coordinates in user space.
AddPath(CGPath)
Adds the specified path to the current path.
AddQuadCurveToPoint(nfloat, nfloat, nfloat, nfloat)
Adds a quadratic Bézier curve to the current path.
AddRect(CGRect)
Adds a rectangular path to the current path.
AddRects(CGRect[])
Adds an array of rectangular paths to the current path.
AsBitmapContext() : CGBitmapContext
Casts the CGContext into a CGBitmapContext.
BeginPage(Nullable<CGRect>)
BeginPath()
Starts a new path in the graphics context.
BeginTransparencyLayer(NSDictionary)
With CGContext.EndTransparencyLayer, encloses operations on a fully transparent layer.
BeginTransparencyLayer(CGRect, NSDictionary)
ClearRect(CGRect)
Paints the rectangle transparently.
Clip()
Sets the current path of the graphics context to be the clipping path.
ClipToMask(CGRect, CGImage)
ClipToRect(CGRect)
Modifies the clipping path to be the intersection of the current path and the supplied rectangle.
ClipToRects(CGRect[])
Modifies the current clipping path to be the insersection of the current clipping path and the region specified by the supplied rectangles.
ClosePath()
Closes and completes the current path.
ConcatCTM(CGAffineTransform)
Concatenates the specified transform onto the current transformation matrix.
ContextFillRects(CGRect[])
ConvertPointToUserSpace(CGPoint) : CGPoint
Converts a point from device space coordinates to user space coordinates.
ConvertRectToDeviceSpace(CGRect) : CGRect
Converts a rectangle from user space coordinates to device space coordinates.
ConvertRectToUserSpace(CGRect) : CGRect
Converts a rectangle from device space coordinates to user space coordinates.
ConvertSizeToDeviceSpace(CGSize) : CGSize
Converts a size from user space coordinates to device space coordinates.
ConvertSizeToUserSpace(CGSize) : CGSize
Converts a size from device space coordinates to user space coordinates.
CopyPath() : CGPath
Returns a deep copy of the current path in the current context.
Dispose()
Releases the resources used by the CGContext object.
DrawImage(CGRect, CGImage)
DrawLayer(CGLayer, CGPoint)
Draws a layer into the graphics context at the specified point.
DrawLayer(CGLayer, CGRect)
Draws a layer into the graphics context bounded by the specified rectangle.
DrawLinearGradient(CGGradient, CGPoint, CGPoint, CGGradientDrawingOptions)
DrawPath(CGPathDrawingMode)
Draws the CGContext's current path.
DrawPDFPage(CGPDFPage)
Renders the specified PDF page.
DrawRadialGradient(CGGradient, CGPoint, nfloat, CGPoint, nfloat, CGGradientDrawingOptions)
DrawShading(CGShading)
Renders the specified shading.
DrawTiledImage(CGRect, CGImage)
EndPage()
Called to indicate the end of a page in a page-based context.
EndTransparencyLayer()
Indicates the end of a transparency layer.
EOClip()
Modifies the current clipping path, using the Even-Odd rule.
EOFillPath()
Fills the current path, using the Even-Odd rule.
FillEllipseInRect(CGRect)
Paints the ellipse defined by rect. Afterwards, the current path is reset.
FillPath()
Fills the current path, using Non-Zero Winding rule.
FillRect(CGRect)
Paints the specified rect.
Finalize()
Finalizer for the CGContext object
Flush()
Forces all pending drawing to be rendered.
GetClipBoundingBox() : CGRect
The bounding box of the current clipping path.
GetCTM() : CGAffineTransform
Retrieves the current Context Transformation Matrix.
GetPathBoundingBox() : CGRect
Returns the bounding box for the current path.
GetPathCurrentPoint() : CGPoint
The current point in the CGContext's path.
GetUserSpaceToDeviceSpaceTransform() : CGAffineTransform
The CGAffineTransform that maps user-space coordinates into device-space coordinates.
IsPathEmpty() : Boolean
Whether the current path contains any subpaths.
MoveTo(nfloat, nfloat)
Begins a sub-path at the specified position.
PathContainsPoint(CGPoint, CGPathDrawingMode) : Boolean
PointToDeviceSpace(CGPoint) : CGPoint
Returns a new PointF that converts the user-space point into device space.
ReplacePathWithStrokedPath()
Replaces the current path with the stroked version of the path, based on the stroke paremeters.
ResetClip()
RestoreState()
Sets the state of the CGContext to what it was when CGContext.SaveState was last called.
RotateCTM(nfloat)
Rotates the current transformation matrix by angle radians, with positive values rotating counterclockwise.
SaveState()
Stores the state of the CGContext. (See CGContext.RestoreState.)
ScaleCTM(nfloat, nfloat)
Scales the current transformation matrix.
SelectFont(String, nfloat, CGTextEncoding)
Developers should not use this deprecated method. Developers should use the 'CoreText' API instead.
SetAllowsAntialiasing(Boolean)
Whether the context allows antialiasing.
SetAllowsFontSmoothing(Boolean)
Whether the context allows font smoothing.
SetAllowsFontSubpixelQuantization(Boolean)
Whether the context allows for glyphs to be drawn at subpixel locations.
SetAllowsSubpixelPositioning(Boolean)
Whether the context allows for glyphs to be aligned other than to pixel boundaries.
SetAlpha(nfloat)
Sets the opacity for drawing, in the range 0.0 (transparent) to 1.0 (opaque).
SetBlendMode(CGBlendMode)
Specifies the compositing mode.
SetCharacterSpacing(nfloat)
Adds additional spacing between glyphs.
SetFillColor(CGColor)
Sets the fill color to the specified CGColor.
SetFillColor(nfloat[])
Sets the fill color. CGContext.SetFillColorSpace must be called prior.
SetFillColor(nfloat, nfloat)
Sets the fill color to a gray level, in the range 0 (black) to 1 (white).
SetFillColor(nfloat, nfloat, nfloat, nfloat)
Sets the fill color to the specified RGBA values.
SetFillColor(nfloat, nfloat, nfloat, nfloat, nfloat)
Sets the fill color using CMYK color-space components, plus an alpha value.
SetFillColorSpace(CGColorSpace)
Specifies the CGColorSpace to be used in the context.
SetFillPattern(CGPattern, nfloat[])
Sets the fill pattern of the context.
SetFlatness(nfloat)
The accuracy of curved paths.
SetFont(CGFont)
Sets the CGFont used to render text.
SetFontSize(nfloat)
Sets the size of the font used to rende text.
SetLineCap(CGLineCap)
Sets the style for the ends of lines.
SetLineDash(nfloat, nfloat[])
The pattern to be used for drawing dashed lines.
SetLineDash(nfloat, nfloat[], Int32)
SetLineJoin(CGLineJoin)
Sets the way lines are joined.
SetLineWidth(nfloat)
Sets the width of the stroked line. The line extends for half w to either side of the path.
SetMiterLimit(nfloat)
Specifies the miter limit for connecting lines.
SetPatternPhase(CGSize)
Translates the pattern prior to beginning to tile it.
SetRenderingIntent(CGColorRenderingIntent)
How colors outside the destination color space are handled.
SetShadow(CGSize, nfloat, CGColor)
SetShouldAntialias(Boolean)
Used in conjunction with CGContext.SetAllowsAntialiasing to enable or disable antialiasing.
SetShouldSmoothFonts(Boolean)
Used in conjunction with CGContext.SetAllowsFontSmoothing to enable or disable font smoothing.
SetShouldSubpixelPositionFonts(Boolean)
Used in conjunction with CGContext.SetAllowsSubpixelPositioning to enable or disable glyph alignment with pixels.
SetStrokeColor(CGColor)
Sets the stroke color.
SetStrokeColor(nfloat[])
Sets the stroke color. This API has undefined behavior if you do not set the colorspace beforehand.
SetStrokeColor(nfloat, nfloat)
Sets the stroke color to a grayscale value.
SetStrokeColor(nfloat, nfloat, nfloat, nfloat)
Sets the stroke color to an RGBA color.
SetStrokeColor(nfloat, nfloat, nfloat, nfloat, nfloat)
Sets the stroke color to a CMYKA color.
SetStrokeColorSpace(CGColorSpace)
Sets the CGColorSpace to be used with CGContext.SetStrokeColor(float[]).
SetStrokePattern(CGPattern, nfloat[])
Sets the stroke pattern of the context.
SetTextDrawingMode(CGTextDrawingMode)
Specifies how glyphs should be rendered.
ShouldSubpixelQuantizeFonts(Boolean)
With CGContext.SetAllowsFontSubpixelQuantization, determines whether fonts should be drawn at subpixel locations.
ShowGlyphs(UInt16[])
This method has been deprecated in favor of CoreText.
ShowGlyphs(UInt16[], Int32)
This method has been deprecated in favor of CoreText.
ShowGlyphsAtPoint(nfloat, nfloat, UInt16[])
ShowGlyphsAtPoint(nfloat, nfloat, UInt16[], Int32)
ShowGlyphsAtPositions(UInt16[], CGPoint[], Int32)
ShowGlyphsWithAdvances(UInt16[], CGSize[], Int32)
ShowText(Byte[])
This method has been deprecated in favor of CoreText.
ShowText(String)
This method has been deprecated in favor of CoreText.
ShowText(Byte[], Int32)
This method has been deprecated in favor of CoreText.
ShowText(String, Int32)
This method has been deprecated in favor of CoreText.
ShowTextAtPoint(nfloat, nfloat, Byte[])
ShowTextAtPoint(nfloat, nfloat, String)
ShowTextAtPoint(nfloat, nfloat, Byte[], Int32)
ShowTextAtPoint(nfloat, nfloat, String, Int32)
StrokeEllipseInRect(CGRect)
Strokes the ellipse defined by rect. Afterwards, the current path is reset.
StrokeLineSegments(CGPoint[])
Strokes the lines defined by the pairs in points. Afterwards, the current path is reset.
StrokePath()
Strokes the current path. Afterwards, the current path is reset.
StrokeRect(CGRect)
Strokes the specified rect. Afterwards, the current path is reset.
StrokeRectWithWidth(CGRect, nfloat)
Strokes the rect. The line extends half of width to either side of the rect perimeter.
Synchronize()
Marks a CGContext for update.
TranslateCTM(nfloat, nfloat)
Changes the origin of the user coordinate system.

Protected Methods

Dispose(Boolean)
Releases the resources used by the CGContext object.