---
title: "Layer..::.Serialize Method "
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_WinControls_Layer_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/)

# Layer.Serialize Method 
 
Serializes a layer and its objects.
 
**Namespace:** [Aurigma.GraphicsMill.WinControls](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_WinControls.htm.md)
 **Assembly:** Aurigma.GraphicsMill.WinControls.VectorObjects (in Aurigma.GraphicsMill.WinControls.VectorObjects.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)
The stream that will keep the serialized data.
 
## Remarks
  
To restore the layer from the serialization data, use the [Deserialize(Stream)](https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_WinControls_Layer_Deserialize_1_bca7c9fe.htm.md) method.
 
**Note** 
Remember that binary format used for serialization is highly dependent on the build version, as the API may change from version to version, and properties may be added or removed.
 
**Note** 
This method closes the specified [Stream](http://msdn2.microsoft.com/en-us/8f86tw9e) after serialization.
   
## See Also

### Reference

- [Layer Class](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_WinControls_Layer.htm.md)
- [Aurigma.GraphicsMill.WinControls Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_WinControls.htm.md)
