---
title: "JpegAlignToSampleSizeMode Enumeration"
canonical: https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_JpegAlignToSampleSizeMode.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# JpegAlignToSampleSizeMode Enumeration
 
Contains possible values for aligning to JPEG sample size.
 
**Namespace:** [Aurigma.GraphicsMill.Codecs](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Codecs.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```
Public Enumeration JpegAlignToSampleSizeMode
```
 
```csharp
public enum JpegAlignToSampleSizeMode
```
 
## Members

|   |  Member name |  Description |
| --- | --- | --- |
 |   |  Patch |  Both top left corner location and dimensions of the input rectangle are aligned. You should use this value if you are preparing rectangle (offset and bitmap dimensions) for the [WritePatched(String, Point, Bitmap)](https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Codecs_LosslessJpegTransform_WritePatched_3_f5f3fae2.htm.md) method. |
 |   |  Crop |  Only X and y-coordinates of the top left corner will be aligned. Width and height will not be aligned. Should be used for [WriteCropped(String, Rectangle)](https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Codecs_LosslessJpegTransform_WriteCropped_2_45371d77.htm.md) if no consequent [WritePatched(String, Point, Bitmap)](https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Codecs_LosslessJpegTransform_WritePatched_3_f5f3fae2.htm.md) is implied. Width and height still may be changed to preserver right and bottom position of the input rectangle. However it will not be aligned. |
 
## Remarks
  
These values are used in the [AlignToSampleSize(Rectangle, JpegAlignToSampleSizeMode)](https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Codecs_LosslessJpegTransform_AlignToSampleSize_2_196b06b9.htm.md) method of the [LosslessJpegTransform](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_LosslessJpegTransform.htm.md) class. It specifies whether you need to align only X and y-coordinates of the left top corner, or width and height also.
 
If you need to get cropped JPEG and do not want to patch the file with it, you can use Crop value. In this case the width and height of cropped bitmap can be arbitrary.
 
However if you are going to put a bitmap into the JPEG file (i.e. patch it), width and height of this bitmap must be aligned. In this case you should use Patch value.
   
## See Also

### Reference

- [Aurigma.GraphicsMill.Codecs Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Codecs.htm.md)
