This method frees image data from the memory

[C++Builder]   [ bool = ]imagekitcontrolname->FreeMemory(NativeUInt ImageHandle)
[C++Builder]   [ bool = ]imagekitcontrolname->FreeMemory()
[Delphi]   [ Boolean = ]imagekitcontrolname.FreeMemory(ImageHandle: THandle)
[Delphi]   [ Boolean = ]imagekitcontrolname.FreeMemory

Parameters

Name Explanation
ImageHandle the handle of the image data to be freed from the memory.

Return Value

Returns True if successful, otherwise returns False.

Explanation

The FreeMemory method frees image data from the memory. This method is valid for both raster and vector images as well as Raw data.

When the ImageHandle parameter contains a valid image handle
The image data that the ImageHandle parameter refers to will be processed.

When the ImageHandle parameter contains 0
The image data determined by the LayerNo property will be processed. If the LayerNo property is -1 (the base image) then the image data referred to by the ImageHandle property will be processed. If the value of the LayerNo property is between 0 and 99 then the image data referred to by the Layer(LayerNo).ImageHandle property will be processed.

Note: Even if the image set in the ImageHandle property or the Layer(Index).ImageHandle property is not freed using this method, whenever a new image is set in these properties or the ImageKit Control is destroyed, that image data is automatically freed. However, if you use the FreeMemory method to manually free image data from the memory, it is recommended that you set the image handle for that data to 0 after executing the FreeMemory method.

Example in Delphi:
(1)
     VImageKit1.LayerNo := -1;
     VImageKit1.FreeMemory;
     VImageKit1.ImageHandle := 0;

(2)
     VImageKit1.FreeMemory(VImageKit1.ImageHandle);
     VImageKit1.ImageHandle := 0;

(3)
     VImageKit1.ImageHandle := 0;

*Although (3) does not explicitly call the FreeMemory method, just as in the above (1) and (2), the image data referred to by the ImageHandle property is freed from the memory.

 

The ImageKit10 VCL is a product created by Newtone Corporation