Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   Crossplatform   Server (Not)   Client   Components   Old   Guides
New in version: 5.0   5.1   5.2   5.3   5.4   6.0   6.1   6.2   6.3   6.4   6.5   7.0   7.1    Statistic  

GMImage.Destroy

Releases the image from memory.

Component: GraphicsMagick
Version: 2.0
Mac OS X: Yes
Windows: Yes
Server: Yes
FileMaker Cloud: Yes

MBS( "GMImage.Destroy"; ImageRef )

Parameters

Parameter Description Example value
ImageRef The image reference (a number returned from the GMImage.New functions) 1

Result

Returns "OK" on success.

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.

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


GMImage.Despeckle   -   GMImage.DestroyAll

Feedback: Report problem or ask question.




Links
MBS Realbasic tutorial videos - Nachhilfe in Mendig