<!--
{
  "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/CTRunGetImageBounds(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Text"
    ],
    "preciseIdentifier" : "c:@F@CTRunGetImageBounds"
  },
  "title" : "CTRunGetImageBounds(_:_:_:)"
}
-->

# CTRunGetImageBounds(_:_:_:)

Calculates the image bounds for a glyph range.

```
func CTRunGetImageBounds(_ run: CTRun, _ context: CGContext?, _ range: CFRange) -> CGRect
```

## Parameters

`run`

The run for which to calculate the image bounds.

`context`

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

`range`

The portion of the run to measure. If the length of the range is set to `0`, then the measure operation continues from the start index of the range to the end of the run.

## Return Value

A rectangle that tightly encloses the paths of the run’s glyphs, or, if `run`, `context`, or `range` 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)