---
title: "LosslessJpeg.AlignToMCUSize Method (Point, Bitmap)"
canonical: https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Codecs_LosslessJpeg_AlignToMCUSize_2_53be7bca.htm
product: "Graphics Mill"
---

# LosslessJpeg.AlignToMCUSize Method (Point, Bitmap)
 
Aligns coordinates of the point and bitmap to JPEG Minimum Coded Units (MCU).
 
**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 Rectangle AlignToMCUSize(Point offset,Bitmap bitmap
)
```
 
### Parameters
 
 - offset
     - Type: System.Drawing.Point
A Point at which the *bitmap* should be placed. It will be used as a location of the upper-left corner of the input rectangle.

 - bitmap
     - Type: [Aurigma.GraphicsMill.Bitmap](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Bitmap.htm.md)
A [Bitmap](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Bitmap.htm.md) to aligne. Its width and height will be used as dimensions of the input rectangle.
 
### Return Value
A Rectangle which contains coordinates aligned to MCU. It is always greater or equal than the input rectangle formed by the *offset* and dimensions of the *bitmap*.
 
## Remarks
 This method is used when you need overwrite some portion of JPEG image by some bitmap. Since JPEG compressed data is stored in blocks (samples) of several pixels (typically 8, 16, or other number divisible by 8), you cannot write bitmap by arbitrary coordinates. That's why you need to align coordinates by JPEG Minimum Coded Units (MCU).
   
## See Also

### Reference

- [LosslessJpeg Class](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_LosslessJpeg.htm.md)
- [AlignToMCUSize Overload](https://www.graphicsmill.com/docs/gm/O_T_Aurigma_GraphicsMill_Codecs_LosslessJpeg_AlignToMCUSize.htm.md)
- [Aurigma.GraphicsMill.Codecs Namespace](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill_Codecs.htm.md)
- [LosslessJpeg.WriteCropped()](https://www.graphicsmill.com/docs/gm/O_T_Aurigma_GraphicsMill_Codecs_LosslessJpeg_WriteCropped.htm.md)
- [LosslessJpeg.WritePatched()](https://www.graphicsmill.com/docs/gm/O_T_Aurigma_GraphicsMill_Codecs_LosslessJpeg_WritePatched.htm.md)
