ImageAttributes

System.Drawing.Imaging.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

ImageAttributes()

Initializes a new instance of the ImageAttributes class.

Methods

ClearBrushRemapTable()

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

ClearColorKey(type)

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

Parameter
Type
Description

type

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

ClearColorKey()

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

ClearColorMatrix()

Clears the color-adjustment matrix for the default category.

ClearColorMatrix(type)

Clears the color-adjustment matrix for a specified category.

Parameter
Type
Description

type

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

ClearGamma()

Disables gamma correction for the default category.

ClearGamma(type)

Disables gamma correction for a specified category.

Parameter
Type
Description

type

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

ClearNoOp()

Clears the setting for the default category.

ClearNoOp(type)

Clears the setting for a specified category.

Parameter
Type
Description

type

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

ClearOutputChannel()

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

ClearOutputChannel(type)

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

Parameter
Type
Description

type

An element of 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.

ClearOutputChannelColorProfile(type)

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

Parameter
Type
Description

type

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

ClearRemapTable()

Clears the color-remap table for the default category.

ClearRemapTable(type)

Clears the color-remap table for a specified category.

Parameter
Type
Description

type

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

ClearThreshold()

Clears the threshold value for the default category.

ClearThreshold(type)

Clears the threshold value for a specified category.

Parameter
Type
Description

type

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

Clone()

Creates an exact copy of this ImageAttributes object.

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

Dispose()

Releases all resources used by this ImageAttributes object.

GetAdjustedPalette(palette, type)

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

Parameter
Type
Description

palette

A ColorPalette that on input contains the palette to be adjusted, and on output contains the adjusted palette.

type

An element of ColorAdjustType that specifies the category whose adjustment settings will be applied to the palette.

SetBrushRemapTable(map)

Sets the brush remap table.

Parameter
Type
Description

map

An array of color pairs of type ColorMap.

SetColorKey(colorLow, colorHigh)

Sets the color key for the default category.

Parameter
Type
Description

colorLow

The low color-key value.

colorHigh

The high color-key value.

SetColorKey(colorLow, colorHigh, type)

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

Parameter
Type
Description

colorLow

The low color-key value.

colorHigh

The high color-key value.

type

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

SetColorMatrices(newColorMatrix, grayMatrix)

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

Parameter
Type
Description

newColorMatrix

The color-adjustment matrix.

grayMatrix

The grayscale-adjustment matrix.

SetColorMatrices(newColorMatrix, grayMatrix, flags)

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

Parameter
Type
Description

newColorMatrix

The color-adjustment matrix.

grayMatrix

The grayscale-adjustment matrix.

flags

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

SetColorMatrices(newColorMatrix, grayMatrix, mode, type)

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

Parameter
Type
Description

newColorMatrix

The color-adjustment matrix.

grayMatrix

The grayscale-adjustment matrix.

mode

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

type

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

SetColorMatrix(newColorMatrix)

Sets the color-adjustment matrix for the default category.

Parameter
Type
Description

newColorMatrix

The color-adjustment matrix.

SetColorMatrix(newColorMatrix, flags)

Sets the color-adjustment matrix for the default category.

Parameter
Type
Description

newColorMatrix

The color-adjustment matrix.

flags

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

SetColorMatrix(newColorMatrix, mode, type)

Sets the color-adjustment matrix for a specified category.

Parameter
Type
Description

newColorMatrix

The color-adjustment matrix.

mode

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

type

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

SetGamma(gamma)

Sets the gamma value for the default category.

Parameter
Type
Description

gamma

The gamma correction value.

SetGamma(gamma, type)

Sets the gamma value for a specified category.

Parameter
Type
Description

gamma

The gamma correction value.

type

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

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.

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.

Parameter
Type
Description

type

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

SetOutputChannel(flags)

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

Parameter
Type
Description

flags

An element of ColorChannelFlag that specifies the output channel.

SetOutputChannel(flags, type)

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

Parameter
Type
Description

flags

An element of ColorChannelFlag that specifies the output channel.

type

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

SetOutputChannelColorProfile(colorProfileFilename)

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

Parameter
Type
Description

colorProfileFilename

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(colorProfileFilename, type)

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

Parameter
Type
Description

colorProfileFilename

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

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

SetRemapTable(map)

Sets the color-remap table for the default category.

Parameter
Type
Description

map

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

SetRemapTable(map, type)

Sets the color-remap table for the default category.

Parameter
Type
Description

map

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

type

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

SetThreshold(threshold)

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

Parameter
Type
Description

threshold

A real number that specifies the threshold value.

SetThreshold(threshold, type)

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

Parameter
Type
Description

threshold

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

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

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.

Parameter
Type
Description

mode

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

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.

Parameter
Type
Description

mode

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

color

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

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.

Parameter
Type
Description

mode

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

color

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

clamp

This parameter has no effect. Set it to .

Last updated

Was this helpful?