LevelsEffect(Int32, Int32, Int32) Constructor

Definition

Creates a new LevelsEffect with the specified highlight, midtone, and shadow values.

public:
 LevelsEffect(int highlight, int midtone, int shadow);
public LevelsEffect (int highlight, int midtone, int shadow);
new System.Drawing.Imaging.Effects.LevelsEffect : int * int * int -> System.Drawing.Imaging.Effects.LevelsEffect
Public Sub New (highlight As Integer, midtone As Integer, shadow As Integer)

Parameters

highlight
Int32

Integer in the range 0 through 100 that specifies which pixels should be lightened.

midtone
Int32

Integer in the range -100 through 100 that specifies how much to lighten or darken an image.

shadow
Int32

Integer in the range 0 through 100 that specifies which pixels should be darkened.

Exceptions

highlight or shadow is less than 0 or greater than 100 or

midtone is less than -100 or greater than 100.

Remarks

For the highlight, you can use this adjustment to lighten pixels that are already lighter than a certain threshold. Setting highlight to 100 specifies no change. Setting highlight to t specifies that a color channel value is increased if it is already greater than t percent of full intensity. For example, setting highlight to 90 specifies that all color channel values greater than 90 percent of full intensity are increased.

For the midtone, color channel values in the middle of the intensity range are altered more than color channel values near the minimum or maximum intensity. You can use this adjustment to lighten (or darken) an image without loosing the contrast between the darkest and lightest portions of the image. A value of 0 specifies no change. Positive values specify that the mid-tones are made lighter, and negative values specify that the mid-tones are made darker.

For the shadow, you can use this adjustment to darken pixels that are already darker than a certain threshold. Setting shadow to 0 specifies no change. Setting shadow to t specifies that a color channel value is decreased if it is already less than t percent of full intensity. For example, setting shadow to 10 specifies that all color channel values less than 10 percent of full intensity are decreased.

Applies to