(AutoIt) Compress Bytes
Demonstrates how to compress binary data.
; This example assumes the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
$oFac = ObjCreate("Chilkat_9_5_0.FileAccess")
Local $oFileBytes
$oFileBytes = $oFac.ReadEntireFile("qa_data/bmp/big.bmp")
If ($oFac.LastMethodSuccess <> True) Then
ConsoleWrite($oFac.LastErrorText & @CRLF)
Exit
EndIf
$oCompress = ObjCreate("Chilkat_9_5_0.Compression")
$oCompress.Algorithm = "deflate"
Local $oCompressedBytes
$oCompressedBytes = $oCompress.CompressBytes($oFileBytes)
If ($oCompress.LastMethodSuccess <> True) Then
ConsoleWrite($oCompress.LastErrorText & @CRLF)
Exit
EndIf
Local $bSuccess = $oFac.WriteEntireFile("qa_output/compressedBmp.dat",$oCompressedBytes)
If ($oFac.LastMethodSuccess <> True) Then
ConsoleWrite($oFac.LastErrorText & @CRLF)
Exit
EndIf
|