Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Tcl) Compress BytesDemonstrates how to compress binary data.
load ./chilkat.dll # This example assumes the Chilkat API to have been previously unlocked. # See Global Unlock Sample for sample code. set fac [new_CkFileAccess] set fileBytes [new_CkByteData] set success [CkFileAccess_ReadEntireFile $fac "qa_data/bmp/big.bmp" $fileBytes] if {[CkFileAccess_get_LastMethodSuccess $fac] != 1} then { puts [CkFileAccess_lastErrorText $fac] delete_CkFileAccess $fac delete_CkByteData $fileBytes exit } set compress [new_CkCompression] CkCompression_put_Algorithm $compress "deflate" set compressedBytes [new_CkByteData] set success [CkCompression_CompressBytes $compress $fileBytes $compressedBytes] if {[CkCompression_get_LastMethodSuccess $compress] != 1} then { puts [CkCompression_lastErrorText $compress] delete_CkFileAccess $fac delete_CkByteData $fileBytes delete_CkCompression $compress delete_CkByteData $compressedBytes exit } set success [CkFileAccess_WriteEntireFile $fac "qa_output/compressedBmp.dat" $compressedBytes] if {[CkFileAccess_get_LastMethodSuccess $fac] != 1} then { puts [CkFileAccess_lastErrorText $fac] delete_CkFileAccess $fac delete_CkByteData $fileBytes delete_CkCompression $compress delete_CkByteData $compressedBytes exit } delete_CkFileAccess $fac delete_CkByteData $fileBytes delete_CkCompression $compress delete_CkByteData $compressedBytes |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.