<!--
{
  "availability" : [
    "iOS: 4.0.0 - 18.0.0",
    "iPadOS: 4.0.0 - 18.0.0",
    "macCatalyst: 13.1.0 - 18.0.0",
    "macOS: 10.7.0 - 15.0.0",
    "tvOS: 9.0.0 - 18.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVAssetImageGenerator/copyCGImage(at:actualTime:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAssetImageGenerator(im)copyCGImageAtTime:actualTime:error:"
  },
  "title" : "copyCGImage(at:actualTime:)"
}
-->

# copyCGImage(at:actualTime:)

Returns an image for the asset at or near a specified time.

```
func copyCGImage(at requestedTime: CMTime, actualTime: UnsafeMutablePointer<CMTime>?) throws -> CGImage
```

## Parameters

`requestedTime`

A time within the asset timeline for which to create an image.

`actualTime`

Upon return, contains the time at which the image was actually generated.

    If you’re not interested in this information, pass     `NULL`    .

## Return Value

A <doc://com.apple.documentation/documentation/CoreGraphics/CGImage> for the asset at or near a specified time, or `NULL` if the image could not be created.

## Discussion

This method returns the image synchronously.

---

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)