186 references to ColorAdjustType
System.Drawing (1)
System.Drawing.cs (1)
70
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.Imaging.
ColorAdjustType
))]
System.Drawing.Common (58)
System\Drawing\Imaging\ImageAttributes.cs (58)
102
SetColorMatrix(newColorMatrix, ColorMatrixFlag.Default,
ColorAdjustType
.Default);
108
SetColorMatrix(newColorMatrix, flags,
ColorAdjustType
.Default);
113
public void SetColorMatrix(ColorMatrix newColorMatrix, ColorMatrixFlag mode,
ColorAdjustType
type) =>
119
public void ClearColorMatrix() => ClearColorMatrix(
ColorAdjustType
.Default);
124
public void ClearColorMatrix(
ColorAdjustType
type)
141
SetColorMatrices(newColorMatrix, grayMatrix, ColorMatrixFlag.Default,
ColorAdjustType
.Default);
144
SetColorMatrices(newColorMatrix, grayMatrix, flags,
ColorAdjustType
.Default);
150
ColorAdjustType
type)
185
public void SetThreshold(float threshold) => SetThreshold(threshold,
ColorAdjustType
.Default);
187
public void SetThreshold(float threshold,
ColorAdjustType
type) => SetThreshold(threshold, type, enableFlag: true);
189
public void ClearThreshold() => ClearThreshold(
ColorAdjustType
.Default);
191
public void ClearThreshold(
ColorAdjustType
type) => SetThreshold(0.0f, type, enableFlag: false);
193
private void SetThreshold(float threshold,
ColorAdjustType
type, bool enableFlag)
204
public void SetGamma(float gamma) => SetGamma(gamma,
ColorAdjustType
.Default);
206
public void SetGamma(float gamma,
ColorAdjustType
type) => SetGamma(gamma, type, enableFlag: true);
208
public void ClearGamma() => ClearGamma(
ColorAdjustType
.Default);
210
public void ClearGamma(
ColorAdjustType
type) => SetGamma(0.0f, type, enableFlag: false);
212
private void SetGamma(float gamma,
ColorAdjustType
type, bool enableFlag)
223
public void SetNoOp() => SetNoOp(
ColorAdjustType
.Default);
225
public void SetNoOp(
ColorAdjustType
type) => SetNoOp(type, enableFlag: true);
227
public void ClearNoOp() => ClearNoOp(
ColorAdjustType
.Default);
229
public void ClearNoOp(
ColorAdjustType
type) => SetNoOp(type, enableFlag: false);
231
private void SetNoOp(
ColorAdjustType
type, bool enableFlag)
242
SetColorKey(colorLow, colorHigh,
ColorAdjustType
.Default);
244
public void SetColorKey(Color colorLow, Color colorHigh,
ColorAdjustType
type) =>
247
public void ClearColorKey() => ClearColorKey(
ColorAdjustType
.Default);
249
public void ClearColorKey(
ColorAdjustType
type) => SetColorKey(Color.Empty, Color.Empty, type, enableFlag: false);
251
private void SetColorKey(Color colorLow, Color colorHigh,
ColorAdjustType
type, bool enableFlag)
263
public void SetOutputChannel(ColorChannelFlag flags) => SetOutputChannel(flags,
ColorAdjustType
.Default);
265
public void SetOutputChannel(ColorChannelFlag flags,
ColorAdjustType
type) =>
268
public void ClearOutputChannel() => ClearOutputChannel(
ColorAdjustType
.Default);
270
public void ClearOutputChannel(
ColorAdjustType
type) =>
273
private void SetOutputChannel(
ColorAdjustType
type, ColorChannelFlag flags, bool enableFlag)
285
SetOutputChannelColorProfile(colorProfileFilename,
ColorAdjustType
.Default);
287
public void SetOutputChannelColorProfile(string colorProfileFilename,
ColorAdjustType
type)
304
public void ClearOutputChannelColorProfile() => ClearOutputChannel(
ColorAdjustType
.Default);
306
public void ClearOutputChannelColorProfile(
ColorAdjustType
type)
317
/// <inheritdoc cref="SetRemapTable(ColorMap[],
ColorAdjustType
)"/>
318
public void SetRemapTable(params ColorMap[] map) => SetRemapTable(map,
ColorAdjustType
.Default);
323
/// <inheritdoc cref="SetRemapTable(
ColorAdjustType
, ReadOnlySpan{ColorMap})"/>
327
public void SetRemapTable(ColorMap[] map,
ColorAdjustType
type)
334
/// <inheritdoc cref="SetRemapTable(ColorMap[],
ColorAdjustType
)"/>
335
public void SetRemapTable(params ReadOnlySpan<ColorMap> map) => SetRemapTable(
ColorAdjustType
.Default, map);
337
/// <inheritdoc cref="SetRemapTable(ColorMap[],
ColorAdjustType
)"/>
338
public void SetRemapTable(params ReadOnlySpan<(Color OldColor, Color NewColor)> map) => SetRemapTable(
ColorAdjustType
.Default, map);
345
/// An element of <see cref="
ColorAdjustType
"/> that specifies the category for which the color-remap table is set.
355
void SetRemapTable(
ColorAdjustType
type, params ReadOnlySpan<ColorMap> map)
382
/// <inheritdoc cref="SetRemapTable(
ColorAdjustType
, ReadOnlySpan{ColorMap})"/>
383
public void SetRemapTable(
ColorAdjustType
type, params ReadOnlySpan<(Color OldColor, Color NewColor)> map)
413
public void ClearRemapTable() => ClearRemapTable(
ColorAdjustType
.Default);
415
public void ClearRemapTable(
ColorAdjustType
type)
427
public void SetBrushRemapTable(params ColorMap[] map) => SetRemapTable(map,
ColorAdjustType
.Brush);
430
/// <inheritdoc cref="SetRemapTable(
ColorAdjustType
, ReadOnlySpan{ColorMap})"/>
431
public void SetBrushRemapTable(params ReadOnlySpan<ColorMap> map) => SetRemapTable(
ColorAdjustType
.Brush, map);
433
/// <inheritdoc cref="SetRemapTable(
ColorAdjustType
, ReadOnlySpan{ColorMap})"/>
434
public void SetBrushRemapTable(params ReadOnlySpan<(Color OldColor, Color NewColor)> map) => SetRemapTable(
ColorAdjustType
.Brush, map);
437
public void ClearBrushRemapTable() => ClearRemapTable(
ColorAdjustType
.Brush);
454
public void GetAdjustedPalette(ColorPalette palette,
ColorAdjustType
type)
System.Drawing.Common.Tests (122)
System\Drawing\Imaging\ImageAttributesTests.cs (122)
164
yield return new object[] {
ColorAdjustType
.Default };
165
yield return new object[] {
ColorAdjustType
.Bitmap };
170
public void SetColorMatrix_ColorMatrixDefaultFlagType_Success(
ColorAdjustType
type)
194
yield return new object[] {
ColorAdjustType
.Brush };
195
yield return new object[] {
ColorAdjustType
.Pen };
196
yield return new object[] {
ColorAdjustType
.Text };
201
public void SetColorMatrix_ColorMatrixDefaultFlagTypeI_Success(
ColorAdjustType
type)
224
imageAttr.SetColorMatrix(_greenComponentToZeroColorMatrix, ColorMatrixFlag.Default,
ColorAdjustType
.Default));
234
imageAttr.SetColorMatrix(null, ColorMatrixFlag.Default,
ColorAdjustType
.Default));
239
yield return new object[] { (
ColorAdjustType
.Default - 1) };
240
yield return new object[] {
ColorAdjustType
.Count };
241
yield return new object[] {
ColorAdjustType
.Any };
242
yield return new object[] { (
ColorAdjustType
.Any + 1) };
247
public void SetColorMatrix_InvalidTypes_ThrowsInvalidEnumArgumentException(
ColorAdjustType
type)
268
AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetColorMatrix(_greenComponentToZeroColorMatrix, flag,
ColorAdjustType
.Default));
288
yield return new object[] {
ColorAdjustType
.Default };
289
yield return new object[] {
ColorAdjustType
.Bitmap };
290
yield return new object[] {
ColorAdjustType
.Brush };
291
yield return new object[] {
ColorAdjustType
.Pen };
292
yield return new object[] {
ColorAdjustType
.Text };
297
public void ClearColorMatrix_DefaultFlagType_Success(
ColorAdjustType
type)
328
AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearColorMatrix(
ColorAdjustType
.Default));
333
public void ClearColorMatrix_InvalidTypes_ThrowsInvalidEnumArgumentException(
ColorAdjustType
type)
379
yield return new object[] { ColorMatrixFlag.Default,
ColorAdjustType
.Default, Color.FromArgb(255, 100, 100, 100), Color.FromArgb(255, 100, 0, 100) };
380
yield return new object[] { ColorMatrixFlag.SkipGrays,
ColorAdjustType
.Default, Color.FromArgb(255, 100, 100, 100), Color.FromArgb(255, 100, 100, 100) };
381
yield return new object[] { ColorMatrixFlag.AltGrays,
ColorAdjustType
.Default, Color.FromArgb(255, 100, 100, 100), Color.FromArgb(255, 100, 200, 255) };
382
yield return new object[] { ColorMatrixFlag.Default,
ColorAdjustType
.Bitmap, Color.FromArgb(255, 100, 100, 100), Color.FromArgb(255, 100, 0, 100) };
383
yield return new object[] { ColorMatrixFlag.SkipGrays,
ColorAdjustType
.Bitmap, Color.FromArgb(255, 100, 100, 100), Color.FromArgb(255, 100, 100, 100) };
384
yield return new object[] { ColorMatrixFlag.AltGrays,
ColorAdjustType
.Bitmap, Color.FromArgb(255, 100, 100, 100), Color.FromArgb(255, 100, 200, 255) };
390
(ColorMatrixFlag flag,
ColorAdjustType
type, Color grayShade, Color expectedGrayShade)
406
yield return new object[] { ColorMatrixFlag.Default,
ColorAdjustType
.Pen, Color.FromArgb(255, 100, 100, 100) };
407
yield return new object[] { ColorMatrixFlag.SkipGrays,
ColorAdjustType
.Pen, Color.FromArgb(255, 100, 100, 100) };
408
yield return new object[] { ColorMatrixFlag.AltGrays,
ColorAdjustType
.Pen, Color.FromArgb(255, 100, 100, 100) };
409
yield return new object[] { ColorMatrixFlag.Default,
ColorAdjustType
.Brush, Color.FromArgb(255, 100, 100, 100) };
410
yield return new object[] { ColorMatrixFlag.SkipGrays,
ColorAdjustType
.Brush, Color.FromArgb(255, 100, 100, 100) };
411
yield return new object[] { ColorMatrixFlag.AltGrays,
ColorAdjustType
.Brush, Color.FromArgb(255, 100, 100, 100) };
412
yield return new object[] { ColorMatrixFlag.Default,
ColorAdjustType
.Text, Color.FromArgb(255, 100, 100, 100) };
413
yield return new object[] { ColorMatrixFlag.SkipGrays,
ColorAdjustType
.Text, Color.FromArgb(255, 100, 100, 100) };
414
yield return new object[] { ColorMatrixFlag.AltGrays,
ColorAdjustType
.Text, Color.FromArgb(255, 100, 100, 100) };
419
public void SetColorMatrices_ColorMatrixGrayMatrixFlagsTypesI_Success(ColorMatrixFlag flag,
ColorAdjustType
type, Color grayShade)
442
imageAttr.SetColorMatrices(_greenComponentToZeroColorMatrix, _grayMatrix, ColorMatrixFlag.Default,
ColorAdjustType
.Default));
453
imageAttr.SetColorMatrices(null, _grayMatrix, ColorMatrixFlag.Default,
ColorAdjustType
.Default));
455
imageAttr.SetColorMatrices(_greenComponentToZeroColorMatrix, null, ColorMatrixFlag.AltGrays,
ColorAdjustType
.Default));
460
public void SetColorMatrices_InvalidTypes_ThrowsInvalidEnumArgumentException(
ColorAdjustType
type)
477
imageAttr.SetColorMatrices(_greenComponentToZeroColorMatrix, _grayMatrix, flag,
ColorAdjustType
.Default));
494
public void SetThreshold_ThresholdType_Success(
ColorAdjustType
type)
507
public void SetThreshold_ThresholdTypeI_Success(
ColorAdjustType
type)
529
public void SetThreshold_InvalidType_ThrowsArgumentException(
ColorAdjustType
type)
550
public void ClearThreshold_ThresholdTypeI_Success(
ColorAdjustType
type)
568
AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearThreshold(
ColorAdjustType
.Default));
573
public void ClearThreshold_InvalidTypes_ThrowsArgumentException(
ColorAdjustType
type)
593
public void SetGamma_GammaType_Success(
ColorAdjustType
type)
606
public void SetGamma_GammaTypeI_Success(
ColorAdjustType
type)
624
AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetGamma(2.2f,
ColorAdjustType
.Default));
629
public void SetGamma_InvalidTypes_ThrowsArgumentException(
ColorAdjustType
type)
637
public void ClearGamma_Type_Success(
ColorAdjustType
type)
656
AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearGamma(
ColorAdjustType
.Default));
661
public void ClearGamma_InvalidTypes_ThrowsArgumentException(
ColorAdjustType
type)
683
public void SetNoOp_Type_Success(
ColorAdjustType
type)
704
AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetNoOp(
ColorAdjustType
.Default));
709
public void SetNoOp_InvalidTypes_ThrowsArgumentException(
ColorAdjustType
type)
733
public void ClearNoOp_Type_Success(
ColorAdjustType
type)
750
public void ClearNoOp_TypeI_Success(
ColorAdjustType
type)
772
AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearNoOp(
ColorAdjustType
.Default));
777
public void ClearNoOp_InvalidTypes_ThrowsArgumentException(
ColorAdjustType
type)
799
public void SetColorKey_Type_Success(
ColorAdjustType
type)
814
public void SetColorKey_TypeI_Success(
ColorAdjustType
type)
834
imageAttr.SetColorKey(Color.FromArgb(50, 50, 50), Color.FromArgb(150, 150, 150),
ColorAdjustType
.Default));
839
public void SetColorKey_InvalidTypes_ThrowsArgumentException(
ColorAdjustType
type)
862
public void ClearColorKey_Type_Success(
ColorAdjustType
type)
882
AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearColorKey(
ColorAdjustType
.Default));
887
public void ClearColorKey_InvalidTypes_ThrowsArgumentException(
ColorAdjustType
type)
917
yield return new object[] { ColorChannelFlag.ColorChannelC,
ColorAdjustType
.Default, Color.FromArgb(255, 100, 100, 100), Color.FromArgb(255, 198, 198, 198) };
918
yield return new object[] { ColorChannelFlag.ColorChannelK,
ColorAdjustType
.Default, Color.FromArgb(255, 100, 100, 100), Color.FromArgb(255, 108, 108, 108) };
919
yield return new object[] { ColorChannelFlag.ColorChannelM,
ColorAdjustType
.Default, Color.FromArgb(255, 100, 100, 100), Color.FromArgb(255, 204, 204, 204) };
920
yield return new object[] { ColorChannelFlag.ColorChannelY,
ColorAdjustType
.Default, Color.FromArgb(255, 100, 100, 100), Color.FromArgb(255, 207, 207, 207) };
921
yield return new object[] { ColorChannelFlag.ColorChannelC,
ColorAdjustType
.Bitmap, Color.FromArgb(255, 100, 100, 100), Color.FromArgb(255, 198, 198, 198) };
922
yield return new object[] { ColorChannelFlag.ColorChannelK,
ColorAdjustType
.Bitmap, Color.FromArgb(255, 100, 100, 100), Color.FromArgb(255, 108, 108, 108) };
923
yield return new object[] { ColorChannelFlag.ColorChannelM,
ColorAdjustType
.Bitmap, Color.FromArgb(255, 100, 100, 100), Color.FromArgb(255, 204, 204, 204) };
924
yield return new object[] { ColorChannelFlag.ColorChannelY,
ColorAdjustType
.Bitmap, Color.FromArgb(255, 100, 100, 100), Color.FromArgb(255, 207, 207, 207) };
929
public void SetOutputChannel_FlagType_Success(ColorChannelFlag flag,
ColorAdjustType
type, Color actualColor, Color expectedColor)
943
yield return new object[] { ColorChannelFlag.ColorChannelC,
ColorAdjustType
.Brush, Color.FromArgb(255, 100, 100, 100) };
944
yield return new object[] { ColorChannelFlag.ColorChannelK,
ColorAdjustType
.Brush, Color.FromArgb(255, 100, 100, 100) };
945
yield return new object[] { ColorChannelFlag.ColorChannelM,
ColorAdjustType
.Brush, Color.FromArgb(255, 100, 100, 100) };
946
yield return new object[] { ColorChannelFlag.ColorChannelY,
ColorAdjustType
.Brush, Color.FromArgb(255, 100, 100, 100) };
947
yield return new object[] { ColorChannelFlag.ColorChannelC,
ColorAdjustType
.Pen, Color.FromArgb(255, 100, 100, 100) };
948
yield return new object[] { ColorChannelFlag.ColorChannelK,
ColorAdjustType
.Pen, Color.FromArgb(255, 100, 100, 100) };
949
yield return new object[] { ColorChannelFlag.ColorChannelM,
ColorAdjustType
.Pen, Color.FromArgb(255, 100, 100, 100) };
950
yield return new object[] { ColorChannelFlag.ColorChannelY,
ColorAdjustType
.Pen, Color.FromArgb(255, 100, 100, 100) };
951
yield return new object[] { ColorChannelFlag.ColorChannelC,
ColorAdjustType
.Text, Color.FromArgb(255, 100, 100, 100) };
952
yield return new object[] { ColorChannelFlag.ColorChannelK,
ColorAdjustType
.Text, Color.FromArgb(255, 100, 100, 100) };
953
yield return new object[] { ColorChannelFlag.ColorChannelM,
ColorAdjustType
.Text, Color.FromArgb(255, 100, 100, 100) };
954
yield return new object[] { ColorChannelFlag.ColorChannelY,
ColorAdjustType
.Text, Color.FromArgb(255, 100, 100, 100) };
959
public void SetOutputChannel_FlagTypeI_Success(ColorChannelFlag flag,
ColorAdjustType
type, Color color)
978
AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetOutputChannel(ColorChannelFlag.ColorChannelY,
ColorAdjustType
.Default));
983
public void SetOutputChannel_InvalidTypes_ThrowsArgumentException(
ColorAdjustType
type)
1004
AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetOutputChannel(flag,
ColorAdjustType
.Default));
1023
public void ClearOutputChannel_Type_Success(
ColorAdjustType
type)
1043
AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearOutputChannel(
ColorAdjustType
.Default));
1048
public void ClearOutputChannel_InvalidTypes_ThrowsArgumentException(
ColorAdjustType
type)
1076
imageAttr.SetOutputChannelColorProfile(Helpers.GetTestColorProfilePath("RSWOP.icm"),
ColorAdjustType
.Default));
1084
Assert.Throws<ArgumentNullException>(() => imageAttr.SetOutputChannelColorProfile(null,
ColorAdjustType
.Default));
1092
Assert.Throws<ArgumentException>(() => imageAttr.SetOutputChannelColorProfile(string.Empty,
ColorAdjustType
.Default));
1100
Assert.Throws<ExternalException>(() => imageAttr.SetOutputChannelColorProfile("invalidPath",
ColorAdjustType
.Default));
1109
Assert.Throws<PathTooLongException>(() => imageAttr.SetOutputChannelColorProfile(fileNameTooLong,
ColorAdjustType
.Default));
1114
public void SetOutputChannelColorProfile_InvalidTypes_ThrowsArgumentException(
ColorAdjustType
type)
1137
public void ClearOutputChannelColorProfile_Type_Success(
ColorAdjustType
type)
1158
AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearOutputChannelColorProfile(
ColorAdjustType
.Default));
1163
public void ClearOutputChannelColorProfile_InvalidTypes_ThrowsArgumentException(
ColorAdjustType
type)
1183
public void SetRemapTable_MapType_Success(
ColorAdjustType
type)
1196
public void SetRemapTable_MapTypeI_Success(
ColorAdjustType
type)
1214
AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetRemapTable(_yellowToRedColorMap,
ColorAdjustType
.Default));
1219
public void SetRemapTable_InvalidTypes_ThrowsArgumentException(
ColorAdjustType
type)
1229
Assert.Throws<ArgumentNullException>(() => imageAttr.SetRemapTable(null,
ColorAdjustType
.Default));
1236
Assert.Throws<NullReferenceException>(() => imageAttr.SetRemapTable([null],
ColorAdjustType
.Default));
1243
AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetRemapTable([],
ColorAdjustType
.Default));
1261
public void ClearRemapTable_Type_Success(
ColorAdjustType
type)
1280
AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.ClearRemapTable(
ColorAdjustType
.Default));
1285
public void ClearRemapTable_InvalidTypes_ThrowsArgumentException(
ColorAdjustType
type)
1309
AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.GetAdjustedPalette(bitmap.Palette,
ColorAdjustType
.Default));
1316
Assert.Throws<NullReferenceException>(() => imageAttr.GetAdjustedPalette(null,
ColorAdjustType
.Default));
1321
public void GetAdjustedPalette_InvalidTypes_ThrowsArgumentException(
ColorAdjustType
type)
System.Windows.Forms (4)
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (1)
1037
attr.SetRemapTable(
ColorAdjustType
.Bitmap, new ReadOnlySpan<(Color OldColor, Color NewColor)>(ref map));
System\Windows\Forms\Controls\ToolStrips\ToolStripHighContrastRenderer.cs (1)
504
attrs.SetRemapTable(
ColorAdjustType
.Bitmap, map);
System\Windows\Forms\Rendering\ControlPaint.cs (2)
1494
attributes.SetRemapTable(
ColorAdjustType
.Bitmap, map);
1610
attributes.SetRemapTable(
ColorAdjustType
.Bitmap, new ReadOnlySpan<(Color OldColor, Color NewColor)>(ref map));
System.Windows.Forms.Design (1)
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.EditorButton.cs (1)
132
attributes.SetRemapTable(
ColorAdjustType
.Bitmap, new ReadOnlySpan<(Color OldColor, Color NewColor)>(ref map));