<!--
{
  "availability" : [
    "iOS: 3.2.0 -",
    "iPadOS: 3.2.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreText",
  "identifier" : "/documentation/CoreText/CTLineGetImageBounds(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Text"
    ],
    "preciseIdentifier" : "c:@F@CTLineGetImageBounds"
  },
  "title" : "CTLineGetImageBounds(_:_:)"
}
-->

# CTLineGetImageBounds(_:_:)

Calculates the image bounds for a line.

```
func CTLineGetImageBounds(_ line: CTLine, _ context: CGContext?) -> CGRect
```

## Parameters

`line`

The line whose image bounds are calculated.

`context`

The context for which the image bounds are calculated. This is required because the context could have settings in it that would cause changes in the image bounds.

## Return Value

A rectangle that tightly encloses the paths of the line’s glyphs, or, if the line or context is invalid, <doc://com.apple.documentation/documentation/CoreGraphics/CGRectNull>.

---

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)