---
title: "JpegAlignToSampleSizeMode Enumeration"
canonical: https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_JpegAlignToSampleSizeMode.htm
product: "Graphics Mill"
---

# JpegAlignToSampleSizeMode Enumeration
 
Contains possible values for JPEG sample size alignment.
 
**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 enum JpegAlignToSampleSizeMode
```
 
## Members

 |  Member name |  Description |
| --- | --- |
 |  Crop |  Only coordinates of the upper-left corner will be aligned. Width and height will not be aligned. Should be used for [WriteCropped(String, Rectangle)](https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Codecs_LosslessJpeg_WriteCropped_2_45371d77.htm.md) if no consequent [WritePatched(String, Point, Bitmap)](https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Codecs_LosslessJpeg_WritePatched_3_f5f3fae2.htm.md) is implied. Width and height still may be changed to preserve right and bottom position of the input rectangle. However it will not be aligned. |
 |  Patch |  The entire rectangle is aligned. You should use this value if you are preparing a rectangle (offset and bitmap dimensions) for the [WritePatched(String, Point, Bitmap)](https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Codecs_LosslessJpeg_WritePatched_3_f5f3fae2.htm.md) method. |
 
## Remarks
  
This enumeration is used in the [AlignToMCUSize(Rectangle, JpegAlignToSampleSizeMode)](https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Codecs_LosslessJpeg_AlignToMCUSize_2_196b06b9.htm.md) method of the [LosslessJpeg](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_LosslessJpeg.htm.md) class. It specifies whether to align only coordinates of the upper-left corner, or width and height also.
 
If you need just to crop an image and you do not want to use it as patch for another image, you can use the Crop value. In this case the width and height of the cropping rectangle can be arbitrary.
 
However if you are going to put this image onto another (i.e. patch it), the width and height of this image must be aligned. In this case you should use Patch value.
   
## See Also

### Reference

- [Aurigma.GraphicsMill.Codecs Namespace](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill_Codecs.htm.md)
