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.