Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

CGImageSource.CreateWithURL

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

Component Version macOS Windows Linux Server iOS SDK
CGImageSource 3.4 ✅ Yes ❌ No ❌ No ✅ Yes, on macOS ✅ Yes
MBS( "CGImageSource.CreateWithURL"; URL )   More

Parameters

Parameter Description Example
URL The URL to the file. $URL

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 URL.
Don't forget to call CGImageSource.Release later to release the reference number.
CoreGraphics Image Source reference numbers are starting at 25000 and counting up for each new image source.

Examples

Loads image and shows it:

Set Variable [ $url ; Value: "http://www.monkeybreadsoftware.com/images/fmplugin16.png" ]
Set Variable [ $img ; Value: MBS( "CGImageSource.CreateWithURL"; $url ) ]
Set Field [ test::output ; MBS( "CGImageSource.ImageAtIndex"; $img; 0) ]
Set Variable [ $r ; Value: MBS( "CGImageSource.Release"; $img ) ]

See also

This function checks for a license.

Created 18th August 2014, last changed 4th March 2023


CGImageSource.CreateWithPath - CGImageSource.Export

💬 Ask a question or report a problem