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

CGImageSource.CreateWithPath

Creates an image source that reads from a location specified by a Path.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
CGImageSource 3.4 Yes No Yes, macOS only No Yes
MBS( "CGImageSource.CreateWithPath"; Path )   More

Parameters

Parameter Description Example value
Path The platform specific file path. "/test.jpg"

Result

Returns the reference number for this image source or error message.

Description

Creates an image source that reads from a location specified by a Path.
Don't forget to call CGImageSource.Release later to release the reference number.

This function requires a native path. Use Path.FileMakerPathToNativePath to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use FileDialog functions.
For Server be aware that server has limited permissions and may not be able to access all files on a computer.

Examples

Load image and show it:

Set Variable [ $path ; Value: "/Users/cs/Pictures/IMG_3625.jpg" ]
Set Variable [ $img ; Value: MBS( "CGImageSource.CreateWithPath"; $path ) ]
Set Field [ test::output ; MBS( "CGImageSource.ImageAtIndex"; $img; 0) ]
Set Variable [ $r ; Value: MBS( "CGImageSource.Release"; $img ) ]

See also

Created 18th August 2014, last changed 5th January 2018


CGImageSource.CreateWithData   -   CGImageSource.CreateWithURL

Feedback: Report problem or ask question.




Links
MBS Xojo Chart Plugins