---
title: "Bezier Transform"
canonical: https://www.graphicsmill.com/samples/Transforms/Bezier/Bezier_cs
product: "Graphics Mill"
source: "Transforms/Bezier/Bezier.cs"
---

# Bezier Transform

Performs a Bezier transform on an image using the specified control points.

## Instruction

Apply a Bezier transformation on an image based on the specified control points.

## Usings

```csharp
using Aurigma.GraphicsMill.Transforms;
```

## Code Snippet

```csharp
private static System.Drawing.PointF[] controlPoints = new[]
{
    new System.Drawing.PointF(0.0f, 0.0f),
    new System.Drawing.PointF(200.0f, 164.760284f),
    new System.Drawing.PointF(400.0f, -164.760284f),
    new System.Drawing.PointF(600.0f, 0.0f),
    new System.Drawing.PointF(0.0f, 150.0f),
    new System.Drawing.PointF(200.0f, 314.760284f),
    new System.Drawing.PointF(400.0f, -14.7602825f),
    new System.Drawing.PointF(600.0f, 150.0f),
    new System.Drawing.PointF(0.0f, 300.0f),
    new System.Drawing.PointF(200.0f, 464.760284f),
    new System.Drawing.PointF(400.0f, 135.239716f),
    new System.Drawing.PointF(600.0f, 300.0f),
    new System.Drawing.PointF(0.0f, 450.0f),
    new System.Drawing.PointF(200.0f, 614.760254f),
    new System.Drawing.PointF(400.0f, 285.239716f),
    new System.Drawing.PointF(600.0f, 450.0f),
};

public static void Run()
{
    using (var bitmap = new Bitmap("Chicago.jpg"))
    {
        bitmap.Transforms.ApplyBezier(controlPoints, RgbColor.Transparent, InterpolationMode.High);
        bitmap.Save("Bezier.jpg");
    }
}
```

## Explanation

The code:

- Defines a set of control points that determine the shape of the Bezier curve.
- Applies the Bezier transformation to the image, altering its content according to the curve.
- Saves the transformed image with the specified effect to a file.

## Tags

- [Bitmap](<https://www.graphicsmill.com/samples/tags/bitmap_md>): Working with images via the Bitmap API
- [Transform](<https://www.graphicsmill.com/samples/tags/transform_md>): Image transforms and effects

## Input

- [Chicago.jpg](<https://www.graphicsmill.com/samples/Transforms/compiled/Debug/Chicago_jpg>) (preview)

## Output

- [Bezier.jpg](<https://www.graphicsmill.com/samples/Transforms/compiled/Debug/Bezier_jpg>) (preview)

## Used APIs

- [Aurigma.GraphicsMill.Bitmap.Transforms](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Bitmap_Transforms.htm.md>)
- [Aurigma.GraphicsMill.Transforms.InterpolationMode](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Transforms_InterpolationMode.htm.md>)
- [Aurigma.GraphicsMill.TransformsProvider.ApplyBezier(PointF\[\],Color,InterpolationMode)](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_TransformsProvider_ApplyBezier_3_94517b29.htm.md>)
