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.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5   8.0    Statistic  

CGImageSource.ImageAtIndex

Returns the image associated with the specified index 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.ImageAtIndex"; 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

Returns the image associated with the specified index in an image source.
This function can be used to query previews of various image formats including RAW images. (everything Preview app can also open)

Examples

Convert image from one container and output to other:

Set Variable [ $img ; Value: MBS( "CGImageSource.CreateWithData"; test::input ) ]
Set Field [ test::output ; MBS( "CGImageSource.ImageAtIndex"; $img; 0; "PNG") ]
Set Variable [ $r ; Value: MBS( "CGImageSource.Release"; $img ) ]

See also


CGImageSource.CreateWithURL   -   CGImageSource.Keys

Feedback: Report problem or ask question.




Links
MBS FileMaker Plugins