This method frees image data from the memory
[Visual Basic]   [ Boolean = ]imagekitcontrolname.FreeMemory(ImageHandle As LONG_PTR)
[Visual C++]     [ BOOL = ]imagekitcontrolname.FreeMemory(LONG_PTR ImageHandle)
[VB.NET]   [ Boolean = ]imagekitcontrolname.FreeMemory(ImageHandle Integer(x86) or Long(x64))
[C#.NET]   [ bool = ]imagekitcontrolname.FreeMemory(int(x86) or long(x64) ImageHandle)

* (x86) refers to the 32 bit version, (x64) refers to the 64 bit version.

Parameters

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

Return Value

Returns True (nonzero) if successful, otherwise returns False (0).

Explanation

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


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 Visual Basic:
(1)

     ImageKit1.LayerNo = -1
     ImageKit1.FreeMemory 0
     ImageKit1.ImageHandle = 0

(2)

     ImageKit1.FreeMemory ImageKit1.ImageHandle
     ImageKit1.ImageHandle = 0

(3)

     ImageKit1.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.

Differences from ImageKit7/8

  This method's argument type has changed
The ImageKit9 ActiveX is a product created by Newtone Corporation