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.4   7.5   8.0   8.1   8.2   8.3   8.4   8.5   9.0   9.1    Statistic  

GMImage.Release

Releases the image from memory.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
GraphicsMagick 2.0 Yes Yes Yes Yes Yes
MBS( "GMImage.Release"; ImageRef )   More

(old name: GMImage.Destroy)

Parameters

Parameter Description Example value
ImageRef The image reference number. 1

Result

Returns OK or error.

Description

Releases the image from memory.
Please call this function when you are done with the image to free memory.
The plugin doesn't know whether you need the image later, so it can't free the memory for you.
You can use GMImage.ImageCount to find out how many images are open in memory.

On the long term, we will change all examples to use GMImage.Release instead of GMImage.Destroy and later deprecate GMImage.Destroy and hide it in documentation.

Examples

Show with and height

Let ( [
$Image = MBS("GMImage.NewFromContainer"; GraphicsMagick::image);
$Width = MBS("GMImage.GetWidth";$Image);
$Height = MBS("GMImage.GetHeight";$Image);
$Error = MBS("GMImage.Destroy";$Image)
];
$Width & " x " & $Height )

Create red square and save to container:

Set Variable [$img; Value:MBS( "GMImage.New"; "16x16"; "red" )]
Set Field [test::test; MBS( "GMImage.WriteToPNGContainer"; $img; "test.png" )]
Set Variable [$r; Value:MBS( "GMImage.Destroy"; $img)]

See also

Blog Entries

Created 18th August 2014, last changed 21st December 2018


GMImage.ReduceNoise   -   GMImage.ReleaseAll

Feedback: Report problem or ask question.




Links
MBS Xojo Plugins