Function

QLThumbnailImageCreate

Creates a thumbnail image for the specified file.

Declaration

CGImageRef QLThumbnailImageCreate(CFAllocatorRef allocator, CFURLRef url, CGSize maxThumbnailSize, CFDictionaryRef options);

Parameters

allocator

The allocator to use to create the thumbnail image.

url

The URL locating the file to create a thumbnail image for.

maxThumbnailSize

The maximum desired size of the thumbnail image.

options

A dictionary of options that affect the creation of the thumbnail image. Two options are supported: kQLThumbnailOptionIconModeKey and kQLThumbnailOptionScaleFactorKey.

Return Value

Returns the thumbnail image or NULL if Quick Look does not support this file type

Discussion

This function does not supplant the use of Icon Services by applications as a way to get generic file icons and custom icons stored in the metadata fork of files.

Special Considerations

Thread-safety: This function is thread-safe so you can call it from any thread. However, because it is synchronous, you should generally call it in a background thread.