---
title: "Bitmap..::.Serialize Method "
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Bitmap_Serialize_1_bca7c9fe.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/)

# Bitmap.Serialize Method 
 
Serializes the bitmap object.
 
**Namespace:** [Aurigma.GraphicsMill](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```
Public Sub Serialize ( _stream As Stream _
)
```
 
```csharp
public void Serialize(Stream stream
)
```
 
### Parameters
 
 - stream
     - Type: [System.IO.Stream](http://msdn2.microsoft.com/en-us/8f86tw9e)
 [Stream](http://msdn2.microsoft.com/en-us/8f86tw9e) which will keep the serialized data.
 
## Remarks
  
To restore the bitmap object from the serialization data, use the [Deserialize(Stream)](https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Bitmap_Deserialize_1_bca7c9fe.htm.md) method.
 
You can enable or disable the compression of the serialization data by using the [CompressSerializedData](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Bitmap_CompressSerializedData.htm.md) property. It is recommended to use compression only if you transfer the serialization data through the network (or if the size is critical for any other reason). Otherwise it can noticeable reduce the serialization/deserialization process performance.
 
**Note** 
This method closes the specified [Stream](http://msdn2.microsoft.com/en-us/8f86tw9e) after serialization.
   
## See Also

### Reference

- [Bitmap Class](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md)
- [Aurigma.GraphicsMill Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill.htm.md)
- [Bitmap.CompressSerializedData](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Bitmap_CompressSerializedData.htm.md)
- [Bitmap.Deserialize(Stream)](https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Bitmap_Deserialize_1_bca7c9fe.htm.md)
