Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
13.5
Statistic
FMM
Blog
Queries the value of a property.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
CGImageSource | 3.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes, on macOS | ✅ Yes |
Parameter | Description | Example |
---|---|---|
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 |
Key | The property name to query. | "PixelWidth" |
Returns the value or error message.
Query Image dimensions in pixel :
MBS( "CGImageSource.Property"; $ref; 0; "PixelWidth") & " x " & MBS( "CGImageSource.Property"; $ref; 0; "PixelHeight")
Query Image resolution in dpi:
MBS( "CGImageSource.Property"; $ref; 0; "DPIWidth") & " x " & MBS( "CGImageSource.Property"; $ref; 0; "DPIHeight")
Query GPS of first image:
Set Variable [ $img ; Value: MBS("CGImageSource.CreateWithData"; CGImageSource::ImageFile) ]
Set Variable [ $lat ; Value: MBS("CGImageSource.Property"; $img; 0; "{GPS}.Latitude") ]
Set Variable [ $long ; Value: MBS("CGImageSource.Property"; $img; 0; "{GPS}.Longitude") ]
Show Custom Dialog [ "GPS" ; $lat & " / " & $long ]
Set Variable [ $r ; Value: MBS("CGImageSource.Release"; $img) ]
This function checks for a license.
Created 18th August 2014, last changed 10th January 2020