<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.0.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGContextAddLineToPoint",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Graphics"
    ],
    "preciseIdentifier" : "c:@F@CGContextAddLineToPoint"
  },
  "title" : "CGContextAddLineToPoint"
}
-->

# CGContextAddLineToPoint

Appends a straight line segment from the current point to the provided point .

```
extern void CGContextAddLineToPoint(CGContextRef c, CGFloat x, CGFloat y);
```

## Parameters

`c`

A graphics context whose current path is not empty.

`x`

The x-value, in user space coordinates, for the end of the line segment.

`y`

The y-value, in user space coordinates, for the end of the line segment.

## Discussion

After adding the line segment, the current point is set to the endpoint of the line segment.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)