---
title: "LosslessJpeg.WriteCropped Method (Stream, Rectangle)"
canonical: https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Codecs_LosslessJpeg_WriteCropped_2_b9ff8166.htm
product: "Graphics Mill"
---

# LosslessJpeg.WriteCropped Method (Stream, Rectangle)
 
Crops the image and writes it to the specified Stream.
 
**Namespace:** [Aurigma.GraphicsMill.Codecs](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill_Codecs.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```csharp
public void WriteCropped(Stream stream,Rectangle rectangle
)
```
 
### Parameters
 
 - stream
     - Type: System.IO.Stream
The Stream to save the result.

 - rectangle
     - Type: System.Drawing.Rectangle
The cropping rectangle. The rectangle must be inside the image. Note, coordinates of this rectangle and coordinates of the cropped portion of image may be different.
   
## See Also

### Reference

- [LosslessJpeg Class](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_LosslessJpeg.htm.md)
- [WriteCropped Overload](https://www.graphicsmill.com/docs/gm/O_T_Aurigma_GraphicsMill_Codecs_LosslessJpeg_WriteCropped.htm.md)
- [Aurigma.GraphicsMill.Codecs Namespace](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill_Codecs.htm.md)

### Manual

- [Applying Lossless JPEG Transforms](https://www.graphicsmill.com/docs/gm/applying-lossless-jpeg-transforms.htm.md)
