## BeginContainer() {#begincontainer}

Saves a graphics container with the current state of this Graphics and opens and uses a new graphics container.

```csharp
public GraphicsContainer BeginContainer()
```

### Return Value

This method returns a GraphicsContainer that represents the state of this Graphics at the time of the method call.

### See Also

* class [GraphicsContainer](../../../system.drawing.drawing2d/graphicscontainer/)
* class [Graphics](../)
* namespace [System.Drawing](../../graphics/)
* assembly [Aspose.Drawing](../../../)

---

## BeginContainer(Rectangle, Rectangle, GraphicsUnit) {#begincontainer_1}

Saves a graphics container with the current state of this Graphics and opens and uses a new graphics container with the specified scale transformation.

```csharp
public GraphicsContainer BeginContainer(Rectangle dstrect, Rectangle srcrect, GraphicsUnit unit)
```

| Parameter | Type | Description |
| --- | --- | --- |
| dstrect | Rectangle | Rectangle structure that, together with the srcrect parameter, specifies a scale transformation for the container. |
| srcrect | Rectangle | Rectangle structure that, together with the dstrect parameter, specifies a scale transformation for the container. |
| unit | GraphicsUnit | Member of the GraphicsUnit enumeration that specifies the unit of measure for the container. |

### Return Value

This method returns a GraphicsContainer that represents the state of this Graphics at the time of the method call.

### See Also

* class [GraphicsContainer](../../../system.drawing.drawing2d/graphicscontainer/)
* struct [Rectangle](../../rectangle/)
* enum [GraphicsUnit](../../graphicsunit/)
* class [Graphics](../)
* namespace [System.Drawing](../../graphics/)
* assembly [Aspose.Drawing](../../../)

---

## BeginContainer(RectangleF, RectangleF, GraphicsUnit) {#begincontainer_2}

Saves a graphics container with the current state of this Graphics and opens and uses a new graphics container with the specified scale transformation.

```csharp
public GraphicsContainer BeginContainer(RectangleF dstrect, RectangleF srcrect, GraphicsUnit unit)
```

| Parameter | Type | Description |
| --- | --- | --- |
| dstrect | RectangleF | RectangleF structure that, together with the srcrect parameter, specifies a scale transformation for the container. |
| srcrect | RectangleF | RectangleF structure that, together with the dstrect parameter, specifies a scale transformation for the container. |
| unit | GraphicsUnit | Member of the GraphicsUnit enumeration that specifies the unit of measure for the container. |

### Return Value

This method returns a GraphicsContainer that represents the state of this Graphics at the time of the method call.

### See Also

* class [GraphicsContainer](../../../system.drawing.drawing2d/graphicscontainer/)
* struct [RectangleF](../../rectanglef/)
* enum [GraphicsUnit](../../graphicsunit/)
* class [Graphics](../)
* namespace [System.Drawing](../../graphics/)
* assembly [Aspose.Drawing](../../../)


