ArraySectionTCast2DTFrom, TTo Method

Reinterprets this ArraySectionT as a two-dimensional CastArray2DTFrom, TTo struct, while its element type is cast from TFrom to TTo. This method can be used only when T in this ArraySectionT is a value type that contains no references.

Definition

Namespace: KGySoft.Collections
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
public CastArray2D<TFrom, TTo> Cast2D<TFrom, TTo>(
	int height,
	int width
)
where TFrom : struct, new(), T
where TTo : struct, new()

Parameters

height  Int32
The height of the array to be returned.
width  Int32
The width of the array to be returned.

Type Parameters

TFrom
The actual element type of this ArraySectionT. Must be the same as T.
TTo
The reinterpreted element type after casting.

Return Value

CastArray2DTFrom, TTo
A CastArray2DTFrom, TTo instance for this ArraySectionT.

See Also