Class CGContext

All Implemented Interfaces:
AutoCloseable
Direct Known Subclasses:
CGBitmapContext, CGPDFContext

public class CGContext
extends CFType
  • Constructor Details

    • CGContext

      protected CGContext()
  • Method Details

    • addRects

      public void addRects​(CGRect[] rects)
    • addLines

      public void addLines​(CGPoint[] points)
    • clipToRects

      public void clipToRects​(CGRect[] rects)
    • fillRects

      public void fillRects​(CGRect[] rects)
    • setFillColor

      public void setFillColor​(double[] components)
    • setFillColor

      public void setFillColor​(float[] components)
    • setStrokeColor

      public void setStrokeColor​(double[] components)
    • setStrokeColor

      public void setStrokeColor​(float[] components)
    • setFillPattern

      public void setFillPattern​(CGPattern pattern, double[] components)
    • setFillPattern

      public void setFillPattern​(CGPattern pattern, float[] components)
    • setStrokePattern

      public void setStrokePattern​(CGPattern pattern, double[] components)
    • setStrokePattern

      public void setStrokePattern​(CGPattern pattern, float[] components)
    • setLineDash

      public void setLineDash​(double phase, double[] lengths)
    • setLineDash

      public void setLineDash​(double phase, float[] lengths, long count)
    • strokeLineSegments

      public void strokeLineSegments​(CGPoint[] points)
    • selectFont

      @Deprecated public void selectFont​(String name, double size, CGTextEncoding textEncoding)
      Deprecated.
      Deprecated in iOS 7.0.
      Since:
      Available in iOS 2.0 and later.
    • showText

      @Deprecated public void showText​(String string)
      Deprecated.
      Deprecated in iOS 7.0.
      Since:
      Available in iOS 2.0 and later.
    • showTextAtPoint

      @Deprecated public void showTextAtPoint​(double x, double y, String string)
      Deprecated.
      Deprecated in iOS 7.0.
      Since:
      Available in iOS 2.0 and later.
    • showGlyphs

      @Deprecated public void showGlyphs​(char[] glyphs)
      Deprecated.
      Deprecated in iOS 7.0.
      Since:
      Available in iOS 2.0 and later.
    • showGlyphsAtPoint

      @Deprecated public void showGlyphsAtPoint​(double x, double y, char[] glyphs)
      Deprecated.
      Deprecated in iOS 7.0.
      Since:
      Available in iOS 2.0 and later.
    • showGlyphsAtPositions

      public void showGlyphsAtPositions​(char[] glyphs, CGPoint[] positions, long count)
    • showGlyphsWithAdvances

      @Deprecated public void showGlyphsWithAdvances​(char[] glyphs, CGSize[] advances)
      Deprecated.
      Deprecated in iOS 7.0.
      Since:
      Available in iOS 2.0 and later.
    • getClassTypeID

      public static long getClassTypeID()
    • saveGState

      public void saveGState()
    • restoreGState

      public void restoreGState()
    • scaleCTM

      public void scaleCTM​(double sx, double sy)
    • translateCTM

      public void translateCTM​(double tx, double ty)
    • rotateCTM

      public void rotateCTM​(double angle)
    • concatCTM

      public void concatCTM​(CGAffineTransform transform)
    • getCTM

      public CGAffineTransform getCTM()
    • setLineWidth

      public void setLineWidth​(double width)
    • setLineCap

      public void setLineCap​(CGLineCap cap)
    • setLineJoin

      public void setLineJoin​(CGLineJoin join)
    • setMiterLimit

      public void setMiterLimit​(double limit)
    • setFlatness

      public void setFlatness​(double flatness)
    • setAlpha

      public void setAlpha​(double alpha)
    • setBlendMode

      public void setBlendMode​(CGBlendMode mode)
    • beginPath

      public void beginPath()
    • moveToPoint

      public void moveToPoint​(double x, double y)
    • addLineToPoint

      public void addLineToPoint​(double x, double y)
    • addCurveToPoint

      public void addCurveToPoint​(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y)
    • addQuadCurveToPoint

      public void addQuadCurveToPoint​(double cpx, double cpy, double x, double y)
    • closePath

      public void closePath()
    • addRect

      public void addRect​(CGRect rect)
    • addEllipseInRect

      public void addEllipseInRect​(CGRect rect)
    • addArc

      public void addArc​(double x, double y, double radius, double startAngle, double endAngle, int clockwise)
    • addArcToPoint

      public void addArcToPoint​(double x1, double y1, double x2, double y2, double radius)
    • addPath

      public void addPath​(CGPath path)
    • replacePathWithStrokedPath

      public void replacePathWithStrokedPath()
    • isPathEmpty

      public boolean isPathEmpty()
    • getPathCurrentPoint

      public CGPoint getPathCurrentPoint()
    • getPathBoundingBox

      public CGRect getPathBoundingBox()
    • getPath

      public CGPath getPath()
    • pathContainsPoint

      public boolean pathContainsPoint​(CGPoint point, CGPathDrawingMode mode)
    • drawPath

      public void drawPath​(CGPathDrawingMode mode)
    • fillPath

      public void fillPath()
    • evenOddFillPath

      public void evenOddFillPath()
    • strokePath

      public void strokePath()
    • fillRect

      public void fillRect​(CGRect rect)
    • strokeRect

      public void strokeRect​(CGRect rect)
    • strokeRect

      public void strokeRect​(CGRect rect, double width)
    • clearRect

      public void clearRect​(CGRect rect)
    • fillEllipseInRect

      public void fillEllipseInRect​(CGRect rect)
    • strokeEllipseInRect

      public void strokeEllipseInRect​(CGRect rect)
    • clip

      public void clip()
    • evenOddClip

      public void evenOddClip()
    • resetClip

      public void resetClip()
    • clipToMask

      public void clipToMask​(CGRect rect, CGImage mask)
    • getClipBoundingBox

      public CGRect getClipBoundingBox()
    • clipToRect

      public void clipToRect​(CGRect rect)
    • setFillColor

      public void setFillColor​(CGColor color)
    • setStrokeColor

      public void setStrokeColor​(CGColor color)
    • setFillColorSpace

      public void setFillColorSpace​(CGColorSpace space)
    • setStrokeColorSpace

      public void setStrokeColorSpace​(CGColorSpace space)
    • setPatternPhase

      public void setPatternPhase​(CGSize phase)
    • setGrayFillColor

      public void setGrayFillColor​(double gray, double alpha)
    • setGrayStrokeColor

      public void setGrayStrokeColor​(double gray, double alpha)
    • setRGBFillColor

      public void setRGBFillColor​(double red, double green, double blue, double alpha)
    • setRGBStrokeColor

      public void setRGBStrokeColor​(double red, double green, double blue, double alpha)
    • setCMYKFillColor

      public void setCMYKFillColor​(double cyan, double magenta, double yellow, double black, double alpha)
    • setCMYKStrokeColor

      public void setCMYKStrokeColor​(double cyan, double magenta, double yellow, double black, double alpha)
    • setRenderingIntent

      public void setRenderingIntent​(CGColorRenderingIntent intent)
    • drawImage

      public void drawImage​(CGRect rect, CGImage image)
    • drawTiledImage

      public void drawTiledImage​(CGRect rect, CGImage image)
    • getInterpolationQuality

      public CGInterpolationQuality getInterpolationQuality()
    • setInterpolationQuality

      public void setInterpolationQuality​(CGInterpolationQuality quality)
    • setShadow

      public void setShadow​(CGSize offset, double blur, CGColor color)
    • setShadow

      public void setShadow​(CGSize offset, double blur)
    • drawLinearGradient

      public void drawLinearGradient​(CGGradient gradient, CGPoint startPoint, CGPoint endPoint, CGGradientDrawingOptions options)
    • drawRadialGradient

      public void drawRadialGradient​(CGGradient gradient, CGPoint startCenter, double startRadius, CGPoint endCenter, double endRadius, CGGradientDrawingOptions options)
    • drawShading

      public void drawShading​(CGShading shading)
    • setCharacterSpacing

      public void setCharacterSpacing​(double spacing)
    • setTextPosition

      public void setTextPosition​(double x, double y)
    • getTextPosition

      public CGPoint getTextPosition()
    • setTextMatrix

      public void setTextMatrix​(CGAffineTransform t)
    • getTextMatrix

      public CGAffineTransform getTextMatrix()
    • setTextDrawingMode

      public void setTextDrawingMode​(CGTextDrawingMode mode)
    • setFont

      public void setFont​(CGFont font)
    • setFontSize

      public void setFontSize​(double size)
    • drawPDFPage

      public void drawPDFPage​(CGPDFPage page)
    • beginPage

      public void beginPage​(CGRect mediaBox)
    • endPage

      public void endPage()
    • flush

      public void flush()
    • synchronize

      public void synchronize()
    • setShouldAntialias

      public void setShouldAntialias​(boolean shouldAntialias)
    • setAllowsAntialiasing

      public void setAllowsAntialiasing​(boolean allowsAntialiasing)
    • setShouldSmoothFonts

      public void setShouldSmoothFonts​(boolean shouldSmoothFonts)
    • setAllowsFontSmoothing

      public void setAllowsFontSmoothing​(boolean allowsFontSmoothing)
    • setShouldSubpixelPositionFonts

      public void setShouldSubpixelPositionFonts​(boolean shouldSubpixelPositionFonts)
    • setAllowsFontSubpixelPositioning

      public void setAllowsFontSubpixelPositioning​(boolean allowsFontSubpixelPositioning)
    • setShouldSubpixelQuantizeFonts

      public void setShouldSubpixelQuantizeFonts​(boolean shouldSubpixelQuantizeFonts)
    • setAllowsFontSubpixelQuantization

      public void setAllowsFontSubpixelQuantization​(boolean allowsFontSubpixelQuantization)
    • beginTransparencyLayer

      public void beginTransparencyLayer​(NSDictionary auxiliaryInfo)
    • beginTransparencyLayer

      public void beginTransparencyLayer​(CGRect rect, NSDictionary auxInfo)
    • endTransparencyLayer

      public void endTransparencyLayer()
    • getUserSpaceToDeviceSpaceTransform

      public CGAffineTransform getUserSpaceToDeviceSpaceTransform()
    • convertPointToDeviceSpace

      public CGPoint convertPointToDeviceSpace​(CGPoint point)
    • convertPointToUserSpace

      public CGPoint convertPointToUserSpace​(CGPoint point)
    • convertSizeToDeviceSpace

      public CGSize convertSizeToDeviceSpace​(CGSize size)
    • convertSizeToUserSpace

      public CGSize convertSizeToUserSpace​(CGSize size)
    • convertRectToDeviceSpace

      public CGRect convertRectToDeviceSpace​(CGRect rect)
    • convertRectToUserSpace

      public CGRect convertRectToUserSpace​(CGRect rect)
    • drawLayerInRect

      public void drawLayerInRect​(CGRect rect, CGLayer layer)
    • drawLayerAtPoint

      public void drawLayerAtPoint​(CGPoint point, CGLayer layer)