ImageMan ActiveX Control Version 8
ImageDataSize Property
See Also  Example  Send comments on this topic.

Glossary Item Box


Returns the size of the Image Data when saving an image to memory by querying the hImageData property and also specifies the size of an image written to memory when setting the hImageData property.

Property type

Read-write property


Visual Basic
Public Property ImageDataSize As Long


When querying the hImageData property to write an image to memory this property is set to the size of the image data in the block returned by the hImageData property. The size returned by this property is the size of the image data not the size of the block which may be slightly larger due to memory allocation page size.

When loading an image from memory using the hImageData property this property must first be set to the size of the image data to be loaded.


(Visual Basic)Copy Code
Dim hMemoryBlock As Long
Dim ImageSize As Long

' Save the Image in JPEG Format in Memory

ImageControl1.MemoryFormat = "JPG"

' hMemoryBlock will get the Handle to a global memory block containing
' the JPG Compressed image
hMemoryBlock = ImageControl1.hImageData

' Query the size of the JPG image in the memory block
ImageSize = ImageControl1.ImageDataSize

'Loading an image from a memory block
' Size of Image Data in memory block in bytes if known
ImageControl1.ImageDataSize = ImageSize

' hMemoryBlock is a Handle to a globally allocated memory block.
ImageControl1.hImageData = hMemoryBlock

See Also

© 2014 Data Techniques Inc. All Rights Reserved.