Class ImageAttributes

Class ImageAttributes

Namespace: Aspose.Imaging
Assembly: Aspose.Imaging.dll (25.2.0)

An Aspose.Imaging.ImageAttributes object contains information about how bitmap and metafile colors are manipulated during rendering. An Aspose.Imaging.ImageAttributes object maintains several color-adjustment settings, including color-adjustment matrices, grayscale-adjustment matrices, gamma-correction values, color-map tables, and color-threshold values. During rendering, colors can be corrected, darkened, lightened, and removed. To apply such manipulations, initialize an Aspose.Imaging.ImageAttributes object and pass the path of that Aspose.Imaging.ImageAttributes object (along with the path of an Aspose.Imaging.Image) to the DrawImage method.

public sealed class ImageAttributes

Inheritance

objectImageAttributes

Inherited Members

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

ImageAttributes()

public ImageAttributes()

Methods

ClearBrushRemapTable()

Clears the brush color-remap table of this Aspose.Imaging.ImageAttributes object.

public void ClearBrushRemapTable()

ClearColorKey()

Clears the color key (transparency range) for the default category.

public void ClearColorKey()

ClearColorKey(ColorAdjustType)

Clears the color key (transparency range) for a specified category.

public void ClearColorKey(ColorAdjustType type)

Parameters

type ColorAdjustType

An element of Aspose.Imaging.ColorAdjustType that specifies the category for which the color key is cleared.

ClearColorMatrix()

Clears the color-adjustment matrix for the default category.

public void ClearColorMatrix()

ClearColorMatrix(ColorAdjustType)

Clears the color-adjustment matrix for a specified category.

public void ClearColorMatrix(ColorAdjustType type)

Parameters

type ColorAdjustType

An element of Aspose.Imaging.ColorAdjustType that specifies the category for which the color-adjustment matrix is cleared.

ClearGamma()

Disables gamma correction for the default category.

public void ClearGamma()

ClearGamma(ColorAdjustType)

Disables gamma correction for a specified category.

public void ClearGamma(ColorAdjustType type)

Parameters

type ColorAdjustType

An element of Aspose.Imaging.ColorAdjustType that specifies the category for which gamma correction is disabled.

ClearNoOp()

Clears the NoOp setting for the default category.

public void ClearNoOp()

ClearNoOp(ColorAdjustType)

Clears the NoOp setting for a specified category.

public void ClearNoOp(ColorAdjustType type)

Parameters

type ColorAdjustType

An element of Aspose.Imaging.ColorAdjustType that specifies the category for which the NoOp setting is cleared.

ClearOutputChannel()

Clears the CMYK (cyan-magenta-yellow-black) output channel setting for the default category.

public void ClearOutputChannel()

ClearOutputChannel(ColorAdjustType)

Clears the (cyan-magenta-yellow-black) output channel setting for a specified category.

public void ClearOutputChannel(ColorAdjustType type)

Parameters

type ColorAdjustType

An element of Aspose.Imaging.ColorAdjustType that specifies the category for which the output channel setting is cleared.

ClearOutputChannelColorProfile()

Clears the output channel color profile setting for the default category.

public void ClearOutputChannelColorProfile()

ClearOutputChannelColorProfile(ColorAdjustType)

Clears the output channel color profile setting for a specified category.

public void ClearOutputChannelColorProfile(ColorAdjustType type)

Parameters

type ColorAdjustType

An element of Aspose.Imaging.ColorAdjustType that specifies the category for which the output channel profile setting is cleared.

ClearRemapTable()

Clears the color-remap table for the default category.

public void ClearRemapTable()

ClearRemapTable(ColorAdjustType)

Clears the color-remap table for a specified category.

public void ClearRemapTable(ColorAdjustType type)

Parameters

type ColorAdjustType

An element of Aspose.Imaging.ColorAdjustType that specifies the category for which the remap table is cleared.

ClearThreshold()

Clears the threshold value for the default category.

public void ClearThreshold()

ClearThreshold(ColorAdjustType)

Clears the threshold value for a specified category.

public void ClearThreshold(ColorAdjustType type)

Parameters

type ColorAdjustType

An element of Aspose.Imaging.ColorAdjustType that specifies the category for which the threshold is cleared.

SetBrushRemapTable(ColorMap[])

Sets the color-remap table for the brush category.

public void SetBrushRemapTable(ColorMap[] map)

Parameters

map ColorMap[]

An array of Aspose.Imaging.ColorMap objects.

SetColorKey(Color, Color)

Sets the color key for the default category.

public void SetColorKey(Color colorLow, Color colorHigh)

Parameters

colorLow Color

The low color-key value.

colorHigh Color

The high color-key value.

SetColorKey(Color, Color, ColorAdjustType)

Sets the color key (transparency range) for a specified category.

public void SetColorKey(Color colorLow, Color colorHigh, ColorAdjustType type)

Parameters

colorLow Color

The low color-key value.

colorHigh Color

The high color-key value.

type ColorAdjustType

An element of Aspose.Imaging.ColorAdjustType that specifies the category for which the color key is set.

SetColorMatrices(ColorMatrix, ColorMatrix)

Sets the color-adjustment matrix and the grayscale-adjustment matrix for the default category.

public void SetColorMatrices(ColorMatrix newColorMatrix, ColorMatrix grayMatrix)

Parameters

newColorMatrix ColorMatrix

The color-adjustment matrix.

grayMatrix ColorMatrix

The grayscale-adjustment matrix.

SetColorMatrices(ColorMatrix, ColorMatrix, ColorMatrixFlag)

Sets the color-adjustment matrix and the grayscale-adjustment matrix for the default category.

public void SetColorMatrices(ColorMatrix newColorMatrix, ColorMatrix grayMatrix, ColorMatrixFlag flags)

Parameters

newColorMatrix ColorMatrix

The color-adjustment matrix.

grayMatrix ColorMatrix

The grayscale-adjustment matrix.

flags ColorMatrixFlag

An element of Aspose.Imaging.ColorMatrixFlag that specifies the type of image and color that will be affected by the color-adjustment and grayscale-adjustment matrices.

SetColorMatrices(ColorMatrix, ColorMatrix, ColorMatrixFlag, ColorAdjustType)

Sets the color-adjustment matrix and the grayscale-adjustment matrix for a specified category.

public void SetColorMatrices(ColorMatrix newColorMatrix, ColorMatrix grayMatrix, ColorMatrixFlag mode, ColorAdjustType type)

Parameters

newColorMatrix ColorMatrix

The color-adjustment matrix.

grayMatrix ColorMatrix

The grayscale-adjustment matrix.

mode ColorMatrixFlag

An element of Aspose.Imaging.ColorMatrixFlag that specifies the type of image and color that will be affected by the color-adjustment and grayscale-adjustment matrices.

type ColorAdjustType

An element of Aspose.Imaging.ColorAdjustType that specifies the category for which the color-adjustment and grayscale-adjustment matrices are set.

SetColorMatrix(ColorMatrix)

Sets the color-adjustment matrix for the default category.

public void SetColorMatrix(ColorMatrix newColorMatrix)

Parameters

newColorMatrix ColorMatrix

The color-adjustment matrix.

SetColorMatrix(ColorMatrix, ColorMatrixFlag)

Sets the color-adjustment matrix for the default category.

public void SetColorMatrix(ColorMatrix newColorMatrix, ColorMatrixFlag flags)

Parameters

newColorMatrix ColorMatrix

The color-adjustment matrix.

flags ColorMatrixFlag

An element of Aspose.Imaging.ColorMatrixFlag that specifies the type of image and color that will be affected by the color-adjustment matrix.

SetColorMatrix(ColorMatrix, ColorMatrixFlag, ColorAdjustType)

Sets the color-adjustment matrix for a specified category.

public void SetColorMatrix(ColorMatrix newColorMatrix, ColorMatrixFlag mode, ColorAdjustType type)

Parameters

newColorMatrix ColorMatrix

The color-adjustment matrix.

mode ColorMatrixFlag

An element of Aspose.Imaging.ColorMatrixFlag that specifies the type of image and color that will be affected by the color-adjustment matrix.

type ColorAdjustType

An element of Aspose.Imaging.ColorAdjustType that specifies the category for which the color-adjustment matrix is set.

SetGamma(float)

Sets the gamma value for the default category.

public void SetGamma(float gamma)

Parameters

gamma float

The gamma correction value.

SetGamma(float, ColorAdjustType)

Sets the gamma value for a specified category.

public void SetGamma(float gamma, ColorAdjustType type)

Parameters

gamma float

The gamma correction value.

type ColorAdjustType

An element of the Aspose.Imaging.ColorAdjustType enumeration that specifies the category for which the gamma value is set.

SetNoOp()

Turns off color adjustment for the default category.

public void SetNoOp()

SetNoOp(ColorAdjustType)

Turns off color adjustment for a specified category.

public void SetNoOp(ColorAdjustType type)

Parameters

type ColorAdjustType

An element of Aspose.Imaging.ColorAdjustType that specifies the category for which color correction is turned off.

SetOutputChannel(ColorChannelFlag)

Sets the CMYK (cyan-magenta-yellow-black) output channel for the default category.

public void SetOutputChannel(ColorChannelFlag flags)

Parameters

flags ColorChannelFlag

An element of Aspose.Imaging.ColorChannelFlag that specifies the output channel.

SetOutputChannel(ColorChannelFlag, ColorAdjustType)

Sets the CMYK (cyan-magenta-yellow-black) output channel for a specified category.

public void SetOutputChannel(ColorChannelFlag flags, ColorAdjustType type)

Parameters

flags ColorChannelFlag

An element of Aspose.Imaging.ColorChannelFlag that specifies the output channel.

type ColorAdjustType

An element of Aspose.Imaging.ColorAdjustType that specifies the category for which the output channel is set.

SetOutputChannelColorProfile(string)

Sets the output channel color-profile file for the default category.

public void SetOutputChannelColorProfile(string colorProfileFilename)

Parameters

colorProfileFilename string

The path name of a color-profile file. If the color-profile file is in the %SystemRoot%\System32\Spool\Drivers\Color directory, this parameter can be the file name. Otherwise, this parameter must be the fully qualified path name.

SetOutputChannelColorProfile(string, ColorAdjustType)

Sets the output channel color-profile file for a specified category.

public void SetOutputChannelColorProfile(string colorProfileFilename, ColorAdjustType type)

Parameters

colorProfileFilename string

The path name of a color-profile file. If the color-profile file is in the %SystemRoot%\System32\Spool\Drivers\Color directory, this parameter can be the file name. Otherwise, this parameter must be the fully qualified path name.

type ColorAdjustType

An element of Aspose.Imaging.ColorAdjustType that specifies the category for which the output channel color-profile file is set.

SetRemapTable(ColorMap[])

Sets the color-remap table for the default category.

public void SetRemapTable(ColorMap[] map)

Parameters

map ColorMap[]

An array of color pairs of type Aspose.Imaging.ColorMap. Each color pair contains an existing color (the first value) and the color that it will be mapped to (the second value).

SetRemapTable(ColorMap[], ColorAdjustType)

Sets the color-remap table for a specified category.

public void SetRemapTable(ColorMap[] map, ColorAdjustType type)

Parameters

map ColorMap[]

An array of color pairs of type Aspose.Imaging.ColorMap. Each color pair contains an existing color (the first value) and the color that it will be mapped to (the second value).

type ColorAdjustType

An element of Aspose.Imaging.ColorAdjustType that specifies the category for which the color-remap table is set.

SetThreshold(float)

Sets the threshold (transparency range) for the default category.

public void SetThreshold(float threshold)

Parameters

threshold float

A real number that specifies the threshold value.

SetThreshold(float, ColorAdjustType)

Sets the threshold (transparency range) for a specified category.

public void SetThreshold(float threshold, ColorAdjustType type)

Parameters

threshold float

A threshold value from 0.0 to 1.0 that is used as a breakpoint to sort colors that will be mapped to either a maximum or a minimum value.

type ColorAdjustType

An element of Aspose.Imaging.ColorAdjustType that specifies the category for which the color threshold is set.

SetWrapMode(WrapMode)

Sets the wrap mode that is used to decide how to tile a texture across a shape, or at shape boundaries. A texture is tiled across a shape to fill it in when the texture is smaller than the shape it is filling.

public void SetWrapMode(WrapMode mode)

Parameters

mode WrapMode

An element of Aspose.Imaging.WrapMode that specifies how repeated copies of an image are used to tile an area.

SetWrapMode(WrapMode, Color)

Sets the wrap mode and color used to decide how to tile a texture across a shape, or at shape boundaries. A texture is tiled across a shape to fill it in when the texture is smaller than the shape it is filling.

public void SetWrapMode(WrapMode mode, Color color)

Parameters

mode WrapMode

An element of Aspose.Imaging.WrapMode that specifies how repeated copies of an image are used to tile an area.

color Color

An Aspose.Imaging.ImageAttributes object that specifies the color of pixels outside of a rendered image. This color is visible if the mode parameter is set to Aspose.Imaging.WrapMode.Clamp and the source rectangle passed to DrawImage is larger than the image itself.

SetWrapMode(WrapMode, Color, bool)

Sets the wrap mode and color used to decide how to tile a texture across a shape, or at shape boundaries. A texture is tiled across a shape to fill it in when the texture is smaller than the shape it is filling.

public void SetWrapMode(WrapMode mode, Color color, bool clamp)

Parameters

mode WrapMode

An element of Aspose.Imaging.WrapMode that specifies how repeated copies of an image are used to tile an area.

color Color

A color object that specifies the color of pixels outside of a rendered image. This color is visible if the mode parameter is set to Aspose.Imaging.WrapMode.Clamp and the source rectangle passed to DrawImage is larger than the image itself.

clamp bool

This parameter has no effect. Set it to false.