141 references to WrapMode
System.Drawing (1)
System.Drawing.cs (1)
55
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.Drawing2D.
WrapMode
))]
System.Drawing.Common (45)
System\Drawing\Drawing2D\LinearGradientBrush.cs (5)
266
public
WrapMode
WrapMode
270
WrapMode
mode;
277
if (value is <
WrapMode
.Tile or >
WrapMode
.Clamp)
278
throw new InvalidEnumArgumentException(nameof(value), (int)value, typeof(
WrapMode
));
System\Drawing\Drawing2D\PathGradientBrush.cs (22)
16
public PathGradientBrush(params PointF[] points) : this(points,
WrapMode
.Clamp) { }
20
public PathGradientBrush(params ReadOnlySpan<PointF> points) : this(
WrapMode
.Clamp, points) { }
27
public PathGradientBrush(PointF[] points,
WrapMode
wrapMode) : this(wrapMode, points.OrThrowIfNull().AsSpan()) { }
29
/// <inheritdoc cref="PathGradientBrush(PointF[],
WrapMode
)"/>
35
PathGradientBrush(
WrapMode
wrapMode, params ReadOnlySpan<PointF> points)
37
if (wrapMode is <
WrapMode
.Tile or >
WrapMode
.Clamp)
38
throw new InvalidEnumArgumentException(nameof(wrapMode), (int)wrapMode, typeof(
WrapMode
));
57
public PathGradientBrush(params Point[] points) : this(points,
WrapMode
.Clamp) { }
65
PathGradientBrush(params ReadOnlySpan<Point> points) : this(
WrapMode
.Clamp, points) { }
67
/// <inheritdoc cref="PathGradientBrush(PointF[],
WrapMode
)"/>
68
public PathGradientBrush(Point[] points,
WrapMode
wrapMode) : this(wrapMode, points.OrThrowIfNull().AsSpan()) { }
70
/// <inheritdoc cref="PathGradientBrush(PointF[],
WrapMode
)"/>
76
PathGradientBrush(
WrapMode
wrapMode, params ReadOnlySpan<Point> points)
78
if (wrapMode is <
WrapMode
.Tile or >
WrapMode
.Clamp)
79
throw new InvalidEnumArgumentException(nameof(wrapMode), (int)wrapMode, typeof(
WrapMode
));
391
public
WrapMode
WrapMode
395
WrapMode
mode;
402
if (value is <
WrapMode
.Tile or >
WrapMode
.Clamp)
403
throw new InvalidEnumArgumentException(nameof(value), (int)value, typeof(
WrapMode
));
System\Drawing\Imaging\ImageAttributes.cs (3)
439
public void SetWrapMode(Drawing2D.
WrapMode
mode) => SetWrapMode(mode, default, clamp: false);
441
public void SetWrapMode(Drawing2D.
WrapMode
mode, Color color) => SetWrapMode(mode, color, clamp: false);
443
public void SetWrapMode(Drawing2D.
WrapMode
mode, Color color, bool clamp)
System\Drawing\TextureBrush.cs (15)
17
public TextureBrush(Image bitmap) : this(bitmap, Drawing2D.
WrapMode
.Tile)
21
public TextureBrush(Image image, Drawing2D.
WrapMode
wrapMode)
25
if (wrapMode is < Drawing2D.
WrapMode
.Tile or > Drawing2D.
WrapMode
.Clamp)
27
throw new InvalidEnumArgumentException(nameof(wrapMode), (int)wrapMode, typeof(Drawing2D.
WrapMode
));
36
public TextureBrush(Image image, Drawing2D.
WrapMode
wrapMode, RectangleF dstRect)
40
if (wrapMode is < Drawing2D.
WrapMode
.Tile or > Drawing2D.
WrapMode
.Clamp)
42
throw new InvalidEnumArgumentException(nameof(wrapMode), (int)wrapMode, typeof(Drawing2D.
WrapMode
));
55
public TextureBrush(Image image, Drawing2D.
WrapMode
wrapMode, Rectangle dstRect)
120
public Drawing2D.
WrapMode
WrapMode
127
return (Drawing2D.
WrapMode
)mode;
131
if (value is < Drawing2D.
WrapMode
.Tile or > Drawing2D.
WrapMode
.Clamp)
133
throw new InvalidEnumArgumentException(nameof(value), (int)value, typeof(Drawing2D.
WrapMode
));
System.Drawing.Common.Tests (91)
System\Drawing\Drawing2D\LinearGradientBrushTests.cs (18)
34
Assert.Equal(
WrapMode
.Tile, brush.WrapMode);
61
Assert.Equal(
WrapMode
.Tile, brush.WrapMode);
95
Assert.Equal(
WrapMode
.Tile, brush.WrapMode);
112
Assert.Equal(
WrapMode
.Tile, brush.WrapMode);
138
Assert.Equal(
WrapMode
.Tile, brush.WrapMode);
155
Assert.Equal(
WrapMode
.Tile, brush.WrapMode);
181
Assert.Equal(
WrapMode
.Tile, brush.WrapMode);
198
Assert.Equal(
WrapMode
.Tile, brush.WrapMode);
602
[InlineData(
WrapMode
.Tile)]
603
[InlineData(
WrapMode
.TileFlipX)]
604
[InlineData(
WrapMode
.TileFlipXY)]
605
[InlineData(
WrapMode
.TileFlipY)]
606
public void WrapMode_SetValid_GetReturnsExpected(
WrapMode
wrapMode)
613
[InlineData(
WrapMode
.Tile - 1)]
614
[InlineData(
WrapMode
.Clamp + 1)]
615
public void WrapMode_SetInvalid_ThrowsInvalidEnumArgumentException(
WrapMode
wrapMode)
625
AssertExtensions.Throws<ArgumentException>(null, () => brush.WrapMode =
WrapMode
.Clamp);
635
AssertExtensions.Throws<ArgumentException>(null, () => brush.WrapMode =
WrapMode
.TileFlipX);
System\Drawing\Drawing2D\PathGradientBrushTests.cs (19)
42
Assert.Equal(
WrapMode
.Clamp, bi.WrapMode);
44
Assert.Equal(
WrapMode
.Clamp, bf.WrapMode);
49
yield return new object[] {
WrapMode
.Clamp };
50
yield return new object[] {
WrapMode
.Tile };
51
yield return new object[] {
WrapMode
.TileFlipX };
52
yield return new object[] {
WrapMode
.TileFlipXY };
53
yield return new object[] {
WrapMode
.TileFlipY };
58
public void Ctor_PointsWrapMode_ReturnsExpected(
WrapMode
wrapMode)
81
Assert.Throws<ArgumentException>(() => new PathGradientBrush(new Point[pointsLength],
WrapMode
.Clamp));
83
Assert.Throws<ArgumentException>(() => new PathGradientBrush(new PointF[pointsLength],
WrapMode
.Clamp));
90
new PathGradientBrush(_defaultIntPoints, (
WrapMode
)int.MaxValue));
93
new PathGradientBrush(_defaultFloatPoints, (
WrapMode
)int.MaxValue));
102
Assert.Equal(
WrapMode
.Clamp, brush.WrapMode);
127
Assert.Equal(
WrapMode
.Clamp, clone.WrapMode);
224
using PathGradientBrush brush = new(_defaultFloatPoints,
WrapMode
.TileFlipXY);
258
using PathGradientBrush brush = new(_defaultFloatPoints,
WrapMode
.TileFlipXY);
277
using PathGradientBrush brush = new(_defaultFloatPoints,
WrapMode
.TileFlipXY);
919
public void WrapMode_ReturnsExpected(
WrapMode
wrapMode)
939
Assert.ThrowsAny<ArgumentException>(() => brush.WrapMode = (
WrapMode
)int.MinValue);
System\Drawing\Imaging\ImageAttributesTests.cs (3)
1297
AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetWrapMode(
WrapMode
.Clamp));
1298
AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetWrapMode(
WrapMode
.Clamp, Color.Black));
1299
AssertExtensions.Throws<ArgumentException>(null, () => imageAttr.SetWrapMode(
WrapMode
.Clamp, Color.Black, true));
System\Drawing\TextureBrushTests.cs (51)
31
Assert.Equal(
WrapMode
.Tile, brush.WrapMode);
51
yield return new object[] { ((Image)data[0]).Clone(),
WrapMode
.Clamp, data[1], data[2] };
52
yield return new object[] { ((Image)data[0]).Clone(),
WrapMode
.Tile, data[1], data[2] };
53
yield return new object[] { ((Image)data[0]).Clone(),
WrapMode
.TileFlipX, data[1], data[2] };
54
yield return new object[] { ((Image)data[0]).Clone(),
WrapMode
.TileFlipXY, data[1], data[2] };
55
yield return new object[] { ((Image)data[0]).Clone(),
WrapMode
.TileFlipY, data[1], data[2] };
61
public void Ctor_Image_WrapMode(Image image,
WrapMode
wrapMode, PixelFormat expectedPixelFormat, Size expectedSize)
99
Assert.Equal(
WrapMode
.Tile, brush.WrapMode);
120
Assert.Equal(
WrapMode
.Tile, brush.WrapMode);
132
yield return new object[] { ((Image)data[0]).Clone(),
WrapMode
.Clamp, data[1] };
133
yield return new object[] { ((Image)data[0]).Clone(),
WrapMode
.Tile, data[1] };
134
yield return new object[] { ((Image)data[0]).Clone(),
WrapMode
.TileFlipX, data[1] };
135
yield return new object[] { ((Image)data[0]).Clone(),
WrapMode
.TileFlipXY, data[1] };
136
yield return new object[] { ((Image)data[0]).Clone(),
WrapMode
.TileFlipY, data[1] };
142
public void Ctor_Image_WrapMode_Rectangle(Image image,
WrapMode
wrapMode, Rectangle rectangle)
163
public void Ctor_Image_WrapMode_RectangleF(Image image,
WrapMode
wrapMode, Rectangle rectangle)
186
yield return new object[] { ((Image)data[0]).Clone(), data[1], null,
WrapMode
.Tile };
187
yield return new object[] { ((Image)data[0]).Clone(), data[1], new ImageAttributes(),
WrapMode
.Clamp };
190
customWrapMode.SetWrapMode(
WrapMode
.TileFlipXY);
191
yield return new object[] { ((Image)data[0]).Clone(), data[1], customWrapMode,
WrapMode
.TileFlipXY };
197
public void Ctor_Image_Rectangle_ImageAttributes(Image image, Rectangle rectangle, ImageAttributes attributes,
WrapMode
expectedWrapMode)
219
public void Ctor_Image_RectangleF_ImageAttributes(Image image, Rectangle rectangle, ImageAttributes attributes,
WrapMode
expectedWrapMode)
243
AssertExtensions.Throws<ArgumentNullException>("image", () => new TextureBrush(null,
WrapMode
.Tile));
248
AssertExtensions.Throws<ArgumentNullException>("image", () => new TextureBrush(null,
WrapMode
.Tile, RectangleF.Empty));
249
AssertExtensions.Throws<ArgumentNullException>("image", () => new TextureBrush(null,
WrapMode
.Tile, Rectangle.Empty));
259
AssertExtensions.Throws<ArgumentException>(null, () => new TextureBrush(image,
WrapMode
.Tile));
264
AssertExtensions.Throws<ArgumentException>(null, () => new TextureBrush(image,
WrapMode
.Tile, RectangleF.Empty));
265
AssertExtensions.Throws<ArgumentException>(null, () => new TextureBrush(image,
WrapMode
.Tile, Rectangle.Empty));
269
[InlineData(
WrapMode
.Tile - 1)]
270
[InlineData(
WrapMode
.Clamp + 1)]
271
public void Ctor_InvalidWrapMode_ThrowsInvalidEnumArgumentException(
WrapMode
wrapMode)
294
Assert.Throws<ExternalException>(() => new TextureBrush(image,
WrapMode
.Tile, rectangle));
295
Assert.Throws<ExternalException>(() => new TextureBrush(image,
WrapMode
.Tile, (RectangleF)rectangle));
304
using TextureBrush brush = new(image,
WrapMode
.Clamp);
309
Assert.Equal(
WrapMode
.Clamp, clone.WrapMode);
689
[InlineData(
WrapMode
.Clamp)]
690
[InlineData(
WrapMode
.Tile)]
691
[InlineData(
WrapMode
.TileFlipX)]
692
[InlineData(
WrapMode
.TileFlipXY)]
693
[InlineData(
WrapMode
.TileFlipY)]
694
public void WrapMode_SetValid_GetReturnsExpected(
WrapMode
wrapMode)
703
[InlineData(
WrapMode
.Tile - 1)]
704
[InlineData(
WrapMode
.Clamp + 1)]
705
public void WrapMode_SetInvalid_ThrowsInvalidEnumArgumentException(
WrapMode
wrapMode)
720
AssertExtensions.Throws<ArgumentException>(null, () => brush.WrapMode =
WrapMode
.Tile);
731
VerifyFillRect(
WrapMode
.Clamp,
747
VerifyFillRect(
WrapMode
.Tile,
763
VerifyFillRect(
WrapMode
.TileFlipX,
779
VerifyFillRect(
WrapMode
.TileFlipY,
795
VerifyFillRect(
WrapMode
.TileFlipXY,
804
private static void VerifyFillRect(
WrapMode
wrapMode, Color[][] expectedColors)
System.Windows.Forms (4)
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.cs (1)
831
attr.SetWrapMode(
WrapMode
.TileFlipXY);
System\Windows\Forms\Layout\Containers\SplitContainer.cs (1)
1556
using TextureBrush textureBrush = new(BackgroundImage,
WrapMode
.Tile);
System\Windows\Forms\Rendering\ControlPaint.cs (2)
453
using TextureBrush textureBrush = new(backgroundImage,
WrapMode
.Tile);
539
imageAttrib.SetWrapMode(
WrapMode
.TileFlipXY);