ImageExtensionsIndexOf(Image, Color, Int32) Method
Reports the zero-based pixel index of the first occurrence of the specified Color in this image.
Namespace: DevCase.Extensions.ImageExtensionsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[EditorBrowsableAttribute(EditorBrowsableState.Always)]
public static int IndexOf(
this Image sender,
Color color,
int startIndex
)
<ExtensionAttribute>
<EditorBrowsableAttribute(EditorBrowsableState.Always)>
Public Shared Function IndexOf (
sender As Image,
color As Color,
startIndex As Integer
) As Integer
Dim sender As Image
Dim color As Color
Dim startIndex As Integer
Dim returnValue As Integer
returnValue = sender.IndexOf(color,
startIndex)
public:
[ExtensionAttribute]
[EditorBrowsableAttribute(EditorBrowsableState::Always)]
static int IndexOf(
Image^ sender,
Color color,
int startIndex
)
[<ExtensionAttribute>]
[<EditorBrowsableAttribute(EditorBrowsableState.Always)>]
static member IndexOf :
sender : Image *
color : Color *
startIndex : int -> int
No code example is currently available or this language may not be supported.
- sender Image
-
The source Image.
- color Color
-
The Color to find.
- startIndex Int32
-
The search starting pixel position.
Int32
The zero-based index position of the
Color found, otherwise,
-1.
In Visual Basic and C#, you can call this method as an instance method on any object of type
Image. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
This is a code example.
No code example is currently available or this language may not be supported.
Dim color As Color = Color.FromArgb(117, 228, 26)
Dim bmp As Bitmap = CreateSolidcolorBitmap(New Size(256, 256), color, PixelFormat.Format32bppArgb)
Dim indexOfColor As Integer = bmp.IndexOf(color, startIndex:=0)
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
NotImplementedException
|
Only PixelFormats that has 3 or 4 bytes-per-pixel are supported.
|
ArgumentOutOfRangeException
|
|