ImageAttributes Class

Summary: An ImageAttributes object contains information about how bitmap and metafile colors are manipulated during rendering. An 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 ImageAttributes object and pass the path of that ImageAttributes object (along with the path of an Image) to the DrawImage method.

Module: aspose.imaging

Full Name: aspose.imaging.ImageAttributes

Constructors

NameDescription
ImageAttributes()Initializes a new instance of the ImageAttributes class.

Methods

NameDescription
clear_brush_remap_table()Clears the brush color-remap table of this ImageAttributes object.
clear_color_key()Clears the color key (transparency range) for the default category.
clear_color_key(type)Clears the color key (transparency range) for a specified category.
clear_color_matrix()Clears the color-adjustment matrix for the default category.
clear_color_matrix(type)Clears the color-adjustment matrix for a specified category.
clear_gamma()Disables gamma correction for the default category.
clear_gamma(type)Disables gamma correction for a specified category.
clear_no_op()Clears the NoOp setting for the default category.
clear_no_op(type)Clears the NoOp setting for a specified category.
clear_output_channel()Clears the CMYK (cyan-magenta-yellow-black) output channel setting for the default category.
clear_output_channel(type)Clears the (cyan-magenta-yellow-black) output channel setting for a specified category.
clear_output_channel_color_profile()Clears the output channel color profile setting for the default category.
clear_output_channel_color_profile(type)Clears the output channel color profile setting for a specified category.
clear_remap_table()Clears the color-remap table for the default category.
clear_remap_table(type)Clears the color-remap table for a specified category.
clear_threshold()Clears the threshold value for the default category.
clear_threshold(type)Clears the threshold value for a specified category.
set_brush_remap_table(map)Sets the color-remap table for the brush category.
set_color_key(color_low, color_high)Sets the color key for the default category.
set_color_key(color_low, color_high, type)Sets the color key (transparency range) for a specified category.
set_color_matrices(new_color_matrix, gray_matrix)Sets the color-adjustment matrix and the grayscale-adjustment matrix for the default category.
set_color_matrices(new_color_matrix, gray_matrix, flags)Sets the color-adjustment matrix and the grayscale-adjustment matrix for the default category.
set_color_matrices(new_color_matrix, gray_matrix, mode, type)Sets the color-adjustment matrix and the grayscale-adjustment matrix for a specified category.
set_color_matrix(new_color_matrix)Sets the color-adjustment matrix for the default category.
set_color_matrix(new_color_matrix, flags)Sets the color-adjustment matrix for the default category.
set_color_matrix(new_color_matrix, mode, type)Sets the color-adjustment matrix for a specified category.
set_gamma(gamma)Sets the gamma value for the default category.
set_gamma(gamma, type)Sets the gamma value for a specified category.
set_no_op()Turns off color adjustment for the default category.
set_no_op(type)Turns off color adjustment for a specified category.
set_output_channel(flags)Sets the CMYK (cyan-magenta-yellow-black) output channel for the default category.
set_output_channel(flags, type)Sets the CMYK (cyan-magenta-yellow-black) output channel for a specified category.
set_output_channel_color_profile(color_profile_filename)Sets the output channel color-profile file for the default category.
set_output_channel_color_profile(color_profile_filename, type)Sets the output channel color-profile file for a specified category.
set_remap_table(map)Sets the color-remap table for the default category.
set_remap_table(map, type)Sets the color-remap table for a specified category.
set_threshold(threshold)Sets the threshold (transparency range) for the default category.
set_threshold(threshold, type)Sets the threshold (transparency range) for a specified category.
set_wrap_mode(mode)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.
set_wrap_mode(mode, 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.
set_wrap_mode(mode, color, clamp)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.

Constructor: ImageAttributes()

 ImageAttributes() 

Initializes a new instance of the ImageAttributes class.

Method: clear_color_key(type)

 clear_color_key(type) 

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

Parameters:

ParameterTypeDescription
typeColorAdjustTypeAn element of ColorAdjustType that specifies the category for which the color key is cleared.

Method: clear_color_matrix(type)

 clear_color_matrix(type) 

Clears the color-adjustment matrix for a specified category.

Parameters:

ParameterTypeDescription
typeColorAdjustTypeAn element of ColorAdjustType that specifies the category for which the color-adjustment matrix is cleared.

Method: clear_gamma(type)

 clear_gamma(type) 

Disables gamma correction for a specified category.

Parameters:

ParameterTypeDescription
typeColorAdjustTypeAn element of ColorAdjustType that specifies the category for which gamma correction is disabled.

Method: clear_no_op(type)

 clear_no_op(type) 

Clears the NoOp setting for a specified category.

Parameters:

ParameterTypeDescription
typeColorAdjustTypeAn element of ColorAdjustType that specifies the category for which the NoOp setting is cleared.

Method: clear_output_channel(type)

 clear_output_channel(type) 

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

Parameters:

ParameterTypeDescription
typeColorAdjustTypeAn element of ColorAdjustType that specifies the category for which the output channel setting is cleared.

Method: clear_output_channel_color_profile(type)

 clear_output_channel_color_profile(type) 

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

Parameters:

ParameterTypeDescription
typeColorAdjustTypeAn element of ColorAdjustType that specifies the category for which the output channel profile setting is cleared.

Method: clear_remap_table(type)

 clear_remap_table(type) 

Clears the color-remap table for a specified category.

Parameters:

ParameterTypeDescription
typeColorAdjustTypeAn element of ColorAdjustType that specifies the category for which the remap table is cleared.

Method: clear_threshold(type)

 clear_threshold(type) 

Clears the threshold value for a specified category.

Parameters:

ParameterTypeDescription
typeColorAdjustTypeAn element of ColorAdjustType that specifies the category for which the threshold is cleared.

Method: set_brush_remap_table(map)

 set_brush_remap_table(map) 

Sets the color-remap table for the brush category.

Parameters:

ParameterTypeDescription
mapColorMap[]An array of ColorMap objects.

Method: set_color_key(color_low, color_high)

 set_color_key(color_low, color_high) 

Sets the color key for the default category.

Parameters:

ParameterTypeDescription
color_lowColorThe low color-key value.
color_highColorThe high color-key value.

Method: set_color_key(color_low, color_high, type)

 set_color_key(color_low, color_high, type) 

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

Parameters:

ParameterTypeDescription
color_lowColorThe low color-key value.
color_highColorThe high color-key value.
typeColorAdjustTypeAn element of ColorAdjustType that specifies the category for which the color key is set.

Method: set_color_matrices(new_color_matrix, gray_matrix)

 set_color_matrices(new_color_matrix, gray_matrix) 

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

Parameters:

ParameterTypeDescription
new_color_matrixColorMatrixThe color-adjustment matrix.
gray_matrixColorMatrixThe grayscale-adjustment matrix.

Method: set_color_matrices(new_color_matrix, gray_matrix, flags)

 set_color_matrices(new_color_matrix, gray_matrix, flags) 

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

Parameters:

ParameterTypeDescription
new_color_matrixColorMatrixThe color-adjustment matrix.
gray_matrixColorMatrixThe grayscale-adjustment matrix.
flagsColorMatrixFlagAn element of ColorMatrixFlag that specifies the type of image and color that will be affected by the color-adjustment and grayscale-adjustment matrices.

Method: set_color_matrices(new_color_matrix, gray_matrix, mode, type)

 set_color_matrices(new_color_matrix, gray_matrix, mode, type) 

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

Parameters:

ParameterTypeDescription
new_color_matrixColorMatrixThe color-adjustment matrix.
gray_matrixColorMatrixThe grayscale-adjustment matrix.
modeColorMatrixFlagAn element of ColorMatrixFlag that specifies the type of image and color that will be affected by the color-adjustment and grayscale-adjustment matrices.
typeColorAdjustTypeAn element of ColorAdjustType that specifies the category for which the color-adjustment and grayscale-adjustment matrices are set.

Method: set_color_matrix(new_color_matrix)

 set_color_matrix(new_color_matrix) 

Sets the color-adjustment matrix for the default category.

Parameters:

ParameterTypeDescription
new_color_matrixColorMatrixThe color-adjustment matrix.

Method: set_color_matrix(new_color_matrix, flags)

 set_color_matrix(new_color_matrix, flags) 

Sets the color-adjustment matrix for the default category.

Parameters:

ParameterTypeDescription
new_color_matrixColorMatrixThe color-adjustment matrix.
flagsColorMatrixFlagAn element of ColorMatrixFlag that specifies the type of image and color that will be affected by the color-adjustment matrix.

Method: set_color_matrix(new_color_matrix, mode, type)

 set_color_matrix(new_color_matrix, mode, type) 

Sets the color-adjustment matrix for a specified category.

Parameters:

ParameterTypeDescription
new_color_matrixColorMatrixThe color-adjustment matrix.
modeColorMatrixFlagAn element of ColorMatrixFlag that specifies the type of image and color that will be affected by the color-adjustment matrix.
typeColorAdjustTypeAn element of ColorAdjustType that specifies the category for which the color-adjustment matrix is set.

Method: set_gamma(gamma)

 set_gamma(gamma) 

Sets the gamma value for the default category.

Parameters:

ParameterTypeDescription
gammafloatThe gamma correction value.

Method: set_gamma(gamma, type)

 set_gamma(gamma, type) 

Sets the gamma value for a specified category.

Parameters:

ParameterTypeDescription
gammafloatThe gamma correction value.
typeColorAdjustTypeAn element of the ColorAdjustType enumeration that specifies the category for which the gamma value is set.

Method: set_no_op(type)

 set_no_op(type) 

Turns off color adjustment for a specified category.

Parameters:

ParameterTypeDescription
typeColorAdjustTypeAn element of ColorAdjustType that specifies the category for which color correction is turned off.

Method: set_output_channel(flags)

 set_output_channel(flags) 

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

Parameters:

ParameterTypeDescription
flagsColorChannelFlagAn element of ColorChannelFlag that specifies the output channel.

Method: set_output_channel(flags, type)

 set_output_channel(flags, type) 

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

Parameters:

ParameterTypeDescription
flagsColorChannelFlagAn element of ColorChannelFlag that specifies the output channel.
typeColorAdjustTypeAn element of ColorAdjustType that specifies the category for which the output channel is set.

Method: set_output_channel_color_profile(color_profile_filename)

 set_output_channel_color_profile(color_profile_filename) 

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

Parameters:

ParameterTypeDescription
color_profile_filenamestringThe 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.

Method: set_output_channel_color_profile(color_profile_filename, type)

 set_output_channel_color_profile(color_profile_filename, type) 

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

Parameters:

ParameterTypeDescription
color_profile_filenamestringThe 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.
typeColorAdjustTypeAn element of ColorAdjustType that specifies the category for which the output channel color-profile file is set.

Method: set_remap_table(map)

 set_remap_table(map) 

Sets the color-remap table for the default category.

Parameters:

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

Method: set_remap_table(map, type)

 set_remap_table(map, type) 

Sets the color-remap table for a specified category.

Parameters:

ParameterTypeDescription
mapColorMap[]An array of color pairs of type ColorMap. Each color pair contains an existing color (the first value) and the color that it will be mapped to (the second value).
typeColorAdjustTypeAn element of ColorAdjustType that specifies the category for which the color-remap table is set.

Method: set_threshold(threshold)

 set_threshold(threshold) 

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

Parameters:

ParameterTypeDescription
thresholdfloatA real number that specifies the threshold value.

Method: set_threshold(threshold, type)

 set_threshold(threshold, type) 

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

Parameters:

ParameterTypeDescription
thresholdfloatA 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.
typeColorAdjustTypeAn element of ColorAdjustType that specifies the category for which the color threshold is set.

Method: set_wrap_mode(mode)

 set_wrap_mode(mode) 

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.

Parameters:

ParameterTypeDescription
modeWrapModeAn element of WrapMode that specifies how repeated copies of an image are used to tile an area.

Method: set_wrap_mode(mode, color)

 set_wrap_mode(mode, 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.

Parameters:

ParameterTypeDescription
modeWrapModeAn element of WrapMode that specifies how repeated copies of an image are used to tile an area.
colorColorAn ImageAttributes object that specifies the color of pixels outside of a rendered image. This color is visible if the mode parameter is set to WrapMode.CLAMP and the source rectangle passed to DrawImage is larger than the image itself.

Method: set_wrap_mode(mode, color, clamp)

 set_wrap_mode(mode, color, clamp) 

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.

Parameters:

ParameterTypeDescription
modeWrapModeAn element of WrapMode that specifies how repeated copies of an image are used to tile an area.
colorColorA color object that specifies the color of pixels outside of a rendered image. This color is visible if the mode parameter is set to WrapMode.CLAMP and the source rectangle passed to DrawImage is larger than the image itself.
clampboolThis parameter has no effect. Set it to false.