Function

CGDataProviderCreateWithFilename

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

Declaration

CGDataProviderRef CGDataProviderCreateWithFilename(const char *filename);

Parameters

filename

The full or relative pathname to use for the data provider. When you supply Core Graphics data via the provider, it reads the data from the specified file.

Return Value

A new data provider or NULL if the file could not be opened. You are responsible for releasing this object using CGDataProviderRelease.

Discussion

You use this function to create a direct-access data provider that supplies data from a file. When you supply Core Graphics with a direct-access data provider, Core Graphics obtains data from your program in a single block.

See Also

CGDataProvider Miscellaneous Functions

CGDataProviderCreate

Creates a sequential-access data provider.

CGDataProviderCreateDirectAccess

Creates a direct-access data provider.

CGDataProviderCreateWithData

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

CGDataProviderCreateWithURL

Creates a direct-access data provider that uses a URL 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.