Skip to main content

ImageAttributes

Namespace: System.Drawing.Imaging

Assembly: System.Drawing.Managed (4.0.0.0)

Contains information about how bitmap and metafile colors are manipulated during rendering.

public class ImageAttributes : ICloneable, IDisposable

Constructors

Instance member ImageAttributes()

Initializes a new instance of the ImageAttributes class.

Methods

Instance member ClearBrushRemapTable()

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

Instance member ClearColorKey(type)

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

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

Instance member ClearColorKey()

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

Instance member ClearColorMatrix()

Clears the color-adjustment matrix for the default category.

Instance member ClearColorMatrix(type)

Clears the color-adjustment matrix for a specified category.

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

Instance member ClearGamma()

Disables gamma correction for the default category.

Instance member ClearGamma(type)

Disables gamma correction for a specified category.

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

Instance member ClearNoOp()

Clears the setting for the default category.

Instance member ClearNoOp(type)

Clears the setting for a specified category.

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

Instance member ClearOutputChannel()

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

Instance member ClearOutputChannel(type)

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

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

Instance member ClearOutputChannelColorProfile()

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

Instance member ClearOutputChannelColorProfile(type)

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

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

Instance member ClearRemapTable()

Clears the color-remap table for the default category.

Instance member ClearRemapTable(type)

Clears the color-remap table for a specified category.

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

Instance member ClearThreshold()

Clears the threshold value for the default category.

Instance member ClearThreshold(type)

Clears the threshold value for a specified category.

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

Instance member Clone()

Creates an exact copy of this ImageAttributes object.

Returns: Object. The ImageAttributes object this class creates, cast as an object.

Instance member Dispose()

Releases all resources used by this ImageAttributes object.

Instance member GetAdjustedPalette(palette, type)

Adjusts the colors in a palette according to the adjustment settings of a specified category.

ParameterTypeDescription
paletteColorPaletteA ColorPalette that on input contains the palette to be adjusted, and on output contains the adjusted palette.
typeColorAdjustTypeAn element of ColorAdjustType that specifies the category whose adjustment settings will be applied to the palette.

Instance member SetBrushRemapTable(map)

Sets the brush remap table.

ParameterTypeDescription
mapColorMap[]An array of color pairs of type ColorMap.

Instance member SetColorKey(colorLow, colorHigh)

Sets the color key for the default category.

ParameterTypeDescription
colorLowColorThe low color-key value.
colorHighColorThe high color-key value.

Instance member SetColorKey(colorLow, colorHigh, type)

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

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

Instance member SetColorMatrices(newColorMatrix, grayMatrix)

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

ParameterTypeDescription
newColorMatrixColorMatrixThe color-adjustment matrix.
grayMatrixColorMatrixThe grayscale-adjustment matrix.

Instance member SetColorMatrices(newColorMatrix, grayMatrix, flags)

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

ParameterTypeDescription
newColorMatrixColorMatrixThe color-adjustment matrix.
grayMatrixColorMatrixThe 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.

Instance member SetColorMatrices(newColorMatrix, grayMatrix, mode, type)

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

ParameterTypeDescription
newColorMatrixColorMatrixThe color-adjustment matrix.
grayMatrixColorMatrixThe 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.

Instance member SetColorMatrix(newColorMatrix)

Sets the color-adjustment matrix for the default category.

ParameterTypeDescription
newColorMatrixColorMatrixThe color-adjustment matrix.

Instance member SetColorMatrix(newColorMatrix, flags)

Sets the color-adjustment matrix for the default category.

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

Instance member SetColorMatrix(newColorMatrix, mode, type)

Sets the color-adjustment matrix for a specified category.

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

Instance member SetGamma(gamma)

Sets the gamma value for the default category.

ParameterTypeDescription
gammaSingleThe gamma correction value.

Instance member SetGamma(gamma, type)

Sets the gamma value for a specified category.

ParameterTypeDescription
gammaSingleThe gamma correction value.
typeColorAdjustTypeAn element of ColorAdjustType that specifies the category for which the threshold is cleared.

Instance member SetNoOp()

Turns off color adjustment for the default category. You can call the ClearNoOp method to reinstate the color-adjustment settings that were in place before the call to the SetNoOp method.

Instance member SetNoOp(type)

Turns off color adjustment for a specified category. You can call the ClearNoOp method to reinstate the color-adjustment settings that were in place before the call to the SetNoOp method.

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

Instance member SetOutputChannel(flags)

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

ParameterTypeDescription
flagsColorChannelFlagAn element of ColorChannelFlag that specifies the output channel.

Instance member SetOutputChannel(flags, type)

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

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.

Instance member SetOutputChannelColorProfile(colorProfileFilename)

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

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

Instance member SetOutputChannelColorProfile(colorProfileFilename, type)

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

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

Instance member SetRemapTable(map)

Sets the color-remap table for the default category.

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).

Instance member SetRemapTable(map, type)

Sets the color-remap table for the default category.

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.

Instance member SetThreshold(threshold)

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

ParameterTypeDescription
thresholdSingleA real number that specifies the threshold value.

Instance member SetThreshold(threshold, type)

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

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

Instance member SetWrapMode(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.

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

Instance member SetWrapMode(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.

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 Clamp and the source rectangle passed to DrawImage is larger than the image itself.

Instance member SetWrapMode(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.

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 Clamp and the source rectangle passed to DrawImage is larger than the image itself.
clampBooleanThis parameter has no effect. Set it to .