This documentation is for the old version. Go to the latest Graphics Mill docs

LosslessJpegTransform.AlignToSampleSize Method (Point, Bitmap)

Aligns coordinates of the point and bitmap to the JPEG sample size.

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

Syntax

Visual Basic
Public Function AlignToSampleSize ( _
	offset As Point, _
	bitmap As Bitmap _
) As Rectangle
C#
public Rectangle AlignToSampleSize(
	Point offset,
	Bitmap bitmap
)

Parameters

offset

Type: System.Drawing.Point

Point at which the bitmap should be placed. It will be used as a location of left top corner of the input rectangle.
bitmap

Type: Aurigma.GraphicsMill.Bitmap

Bitmap class instance which specifies a bitmap. Its width and height will be used as dimensions of the input rectangle.

Return Value

Rectangle which contains coordinates aligned to JPEG sample size. 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 file 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 the JPEG sample size.

See Also

Reference