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

JpegAlignToSampleSizeMode Enumeration

Contains possible values for aligning to JPEG sample size.

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

Syntax

Visual Basic
Public Enumeration JpegAlignToSampleSizeMode
C#
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) 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) if no consequent WritePatched(String, Point, Bitmap) 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) method of the LosslessJpegTransform 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