---
title: "Crop"
canonical: https://www.graphicsmill.com/samples/Transforms/Crop/Crop_cs
product: "Graphics Mill"
source: "Transforms/Crop/Crop.cs"
---

# Crop

Crops image.

## Instruction

Crop an image to a specific rectangular region.

## Code Snippet

```csharp
using (var bitmap = new Bitmap("Chicago.jpg"))
{
    bitmap.Transforms.Crop(230, 170, 320, 240);
    bitmap.Save("Crop.jpg");
}
```

## Explanation

The code:

- Reads the image file.
- Crops the image to the specified rectangle (230, 170, 320, 240).
- Saves the cropped image to a new file.

## Tags

- [Bitmap](<https://www.graphicsmill.com/samples/tags/bitmap_md>): Working with images via the Bitmap API
- [Crop](<https://www.graphicsmill.com/samples/tags/crop_md>): Cropping images

## Input

- [Chicago.jpg](<https://www.graphicsmill.com/samples/Transforms/compiled/Debug/Chicago_jpg>) (preview)

## Output

- [Crop.jpg](<https://www.graphicsmill.com/samples/Transforms/compiled/Debug/Crop_jpg>) (preview)

## Used APIs

- [Aurigma.GraphicsMill.Bitmap.Transforms](<https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Bitmap_Transforms.htm.md>)
- [Aurigma.GraphicsMill.TransformsProvider.Crop(Int32,Int32,Int32,Int32)](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_TransformsProvider_Crop_4_951ae041.htm.md>)
