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.

Definition

Namespace: KGySoft.CoreLibraries
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.1.0
C#
public static Array2D<T> AsArray2D<T>(
	this ArraySegment<T> arraySegment,
	int height,
	int width
)

Parameters

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.

Type Parameters

T
The type of the elements in the array.

Return Value

Array2DT
An Array2DT instance using the specified arraySegment as its underlying buffer that has the specified dimensions.

Usage Note

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).

See Also