---
title: "ZipCompressor..::.Compress Method (IntPtr, UInt32, IntPtr, UInt32)"
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_ZipCompressor_Compress_4_f6130501.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# ZipCompressor.Compress Method (IntPtr, UInt32, IntPtr, UInt32)
 
Compresses a byte array with the deflate algorithm (ZIP).
 
**Namespace:** [Aurigma.GraphicsMill](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```
Public Shared Function Compress ( _originData As IntPtr, _originDataSize As UInteger, _compressedData As IntPtr, _compressedDataSize As UInteger _
) As UInteger
```
 
```csharp
public static uint Compress(IntPtr originData,uint originDataSize,IntPtr compressedData,uint compressedDataSize
)
```
 
### Parameters
 
 - originData
     - Type: [System.IntPtr](http://msdn2.microsoft.com/en-us/5he14kz8)
The pointer to unmanaged byte array which stores the data you need to compress.

 - originDataSize
     - Type: [System.UInt32](http://msdn2.microsoft.com/en-us/ctys3981)
The integer value which specifies the length of the input buffer.

 - compressedData
     - Type: [System.IntPtr](http://msdn2.microsoft.com/en-us/5he14kz8)
The pointer to the unmanaged byte array which will get the compressed data. The memory should be allocated by caller.

 - compressedDataSize
     - Type: [System.UInt32](http://msdn2.microsoft.com/en-us/ctys3981)
The integer value which specifies the lenght of the output buffer.
 
### Return Value
The integer value which specifies how many bytes were actually allocated during compression.
 
## Remarks
  
You should guaranty that the length of the output buffer enough to hold the result of compression.
   
## See Also

### Reference

- [ZipCompressor Class](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_ZipCompressor.htm.md)
- [Compress Overload](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_ZipCompressor_Compress.htm.md)
- [Aurigma.GraphicsMill Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill.htm.md)
