Function

CGDataProviderCreateWithData

Creates a direct-access data provider that uses data your program supplies.

Declaration

CGDataProviderRef CGDataProviderCreateWithData(void *info, const void *data, size_t size, CGDataProviderReleaseDataCallback releaseData);

Parameters

info

A pointer to data of any type, or NULL. When Core Graphics calls the function specified in the releaseData parameter, it sends this pointer as its first argument.

data

A pointer to the array of data that the provider contains.

size

A value that specifies the number of bytes that the data provider contains.

releaseData

A pointer to a release callback for the data provider, or NULL. Your release function is called when Core Graphics frees the data provider. For more information, see CGDataProviderReleaseDataCallback.

Return Value

A new data provider. You are responsible for releasing this object using CGDataProviderRelease.

Discussion

You use this function to create a direct-access data provider that uses callback functions to read data from your program an entire block at one time.

See Also

CGDataProvider Miscellaneous Functions

CGDataProviderCreate

Creates a sequential-access data provider.

CGDataProviderCreateDirectAccess

Creates a direct-access data provider.

CGDataProviderCreateWithURL

Creates a direct-access data provider that uses a URL to supply data.

CGDataProviderCreateWithFilename

Creates a direct-access data provider that uses a file to supply data.

CGDataProviderCreateWithCFData

Creates a data provider that reads from a CFData object.

CGDataProviderGetTypeID

Returns the Core Foundation type identifier for data providers.

CGDataProviderCopyData

Returns a copy of the provider’s data.

CGDataProviderRelease

Decrements the retain count of a data provider.

CGDataProviderRetain

Increments the retain count of a data provider.

CGDataProviderCreateSequential

Creates a sequential-access data provider.

CGDataProviderCreateDirect

Creates a direct-access data provider.

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