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