LosslessJpeg.AlignToMCUSize Method (Point, Bitmap)

Aligns coordinates of the point and bitmap to JPEG Minimum Coded Units (MCU).

Namespace: Aurigma.GraphicsMill.Codecs
Assembly: Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)

Syntax

C#
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

A Bitmap 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