Instance Method

copyCGImageAtTime:actualTime:error:

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

Declaration

- (CGImageRef)copyCGImageAtTime:(CMTime)requestedTime actualTime:(CMTime *)actualTime error:(NSError * _Nullable *)outError;

Parameters

requestedTime

The time at which the image of the asset is to be created.

actualTime

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

If you are not interested in this information, pass NULL.

outError

If an error occurs, upon return contains an NSError object that describes the problem.

If you are not interested in this information, pass NULL.

Return Value

A CGImageRef for the asset at or near a specified time, or NULL if the image could not be created.

This method follows The Create Rule.

Discussion

This method returns the image synchronously.

See Also

Generating Images

- generateCGImagesAsynchronouslyForTimes:completionHandler:

Creates a series of image objects for an asset at or near specified times.

AVAssetImageGeneratorCompletionHandler

A block that you use to receive thumbnail images generated from an asset.

AVAssetImageGeneratorResult

The statuses indicating the outcome of image generation.

- cancelAllCGImageGeneration

Cancels all pending image generation requests.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software