ArrayExtensionsAsArray2DT(ArraySegmentT, Int32, Int32) Method
Gets an
Array2DT wrapper for the specified
ArraySegmentT.
The array segment must have enough capacity for the specified
height and
width.
No heap allocation occurs when using this method.
Namespace: KGySoft.CoreLibrariesAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.1.0
public static Array2D<T> AsArray2D<T>(
this ArraySegment<T> arraySegment,
int height,
int width
)
<ExtensionAttribute>
Public Shared Function AsArray2D(Of T) (
arraySegment As ArraySegment(Of T),
height As Integer,
width As Integer
) As Array2D(Of T)
public:
[ExtensionAttribute]
generic<typename T>
static Array2D<T> AsArray2D(
ArraySegment<T> arraySegment,
int height,
int width
)
[<ExtensionAttribute>]
static member AsArray2D :
arraySegment : ArraySegment<'T> *
height : int *
width : int -> Array2D<'T>
- arraySegment ArraySegmentT
- The desired underlying buffer for the Array2DT instance to be created.
It must have sufficient capacity for the specified dimensions.
- height Int32
- The height of the array to be returned.
- width Int32
- The width of the array to be returned.
- T
- The type of the elements in the array.
Array2DTAn
Array2DT instance using the specified
arraySegment as its underlying buffer that has the specified dimensions.In Visual Basic and C#, you can call this method as an instance method on any object of type
ArraySegmentT. 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).