Zip Examples

Example 1.Compress a binary file.

// Open the binary file to zip.

edtFilename = Form.ShowFileOpenDialog()

// Load binary to a BLOB variable.

varBlob = File.LoadBinary(edtFilename)

// Compress varBlob and save result to varBlobZip.

varBlobZip = Zip.ZipBinary(varBlob)

// Save compressed binary stream to a file.

File.SaveBinary("c:\zipbin.bmp", varBlobZip)

Notes:

Example 2. Uncompress a binary file.

// Open the zipped binary file to uncompress.

edtFileZip = Form.ShowFileOpenDialog()

// Load zipped binary to a BLOB variable.

varBlobZip = File.LoadBinary(edtFileZip)

// Uncompress varBlobZip and save to a base64binary variable.

varBlob = Zip.UnzipBinary(varBlobZip)

// Save to a file.

File.SaveBinary("c:\unzipbin.bmp", varBlob)

// Load varBlob to scribble.

scribble1.LoadBitmapBinary(varBlob)

Notes: