To compress entirely in memory, from one memory buffer to another, use the Xceed Compression control's Compress method. Keep in mind that this is a different control than the Xceed Zip control. To uncompress data that has been compressed this way, use the Xceed Compression control's Uncompress method. The output of the Compress method is always a byte array variant.
Below you will find VB and Delphi examples.
Visual Basic
Copy Code
' Don't forget to put an Xceed Compression control on a form Dim CompressedData As Variant Dim OriginalData As Variant
XceedCompression1.Compress "This is some text to compress", CompressedData, True XceedCompression1.Uncompress CompressedData, OriginalData, True
Debug.Print OriginalData
In the example above, the return values of the Compress and Uncompress methods were ignored. Also, an encryption password was not used. However, you could add error checking and passwords, as in the following example:
Visual Basic
Copy Code
Dim CompressedData As Variant Dim OriginalData As Variant Dim ResultCode As xcdError