Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.5   7.0   7.1   7.2   7.3   7.4   7.5   8.0   8.1   8.2    Statistic  

CGImageSource.ThumbnailAtIndex

Creates a thumbnail image of the image located at a specified location in an image source.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
CGImageSource 3.4 Yes No Yes, macOS only No No

MBS( "CGImageSource.ThumbnailAtIndex"; Ref; Index { ; ImageType; Filename } )

Parameters

Parameter Description Example value
Ref The image source reference number returned by CGImageSource.CreateWithData, CGImageSource.CreateWithPath or CGImageSource.CreateWithURL $ref
Index The index of the image to query. -1 for global properties. Else a number from 0 to CGImageSource.Count-1. 0
ImageType Optional
The type of image to return. Either JPEG, PNG, GIF or BMP. Default is JPEG.
"JPEG"
Filename Optional
The filename to use for the picture. Default is "image" with the extension matching the image type.
"test.jpg"

Result

Returns image or error message.

Description

Creates a thumbnail image of the image located at a specified location in an image source.
If the image source is a PDF, this function creates a 72 dpi image of the PDF page specified by the index that you pass.
Maximum thumbnail size is 512 pixel.
This function can be used to query previews of various image formats including RAW images. (everything Preview app can also open)

Examples

Create a thumbnail:

Set Variable [$ref; Value:MBS("CGImageSource.CreateWithData"; MyTable::ImageFile)]
Set Variable [$image; Value:MBS("CGImageSource.ThumbnailAtIndex"; $ref; 0; "JPEG"; "thumbnail.jpg")]
Set Variable [$r; Value:MBS("CGImageSource.Release"; $ref)]

See also


CGImageSource.SupportedTypes   -   CGImageSource.Type

Feedback: Report problem or ask question.




Links
MBS FileMaker Plugins