本文整理汇总了C#中Color4.Size方法的典型用法代码示例。如果您正苦于以下问题:C# Color4.Size方法的具体用法?C# Color4.Size怎么用?C# Color4.Size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Color4
的用法示例。
在下文中一共展示了Color4.Size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Texture
/// <summary>
/// Constructs a texture from a matrix of color data structures that can be applied to rendered 3D objects.
/// </summary>
/// <param name="window">A reference to the Direct3D-capable window in which this texture will be rendered.</param>
/// <param name="image">A matrix of RGBA color vectors with 32 bits of data per channel.</param>
public Texture(Window3D window, Color4[,] image)
: this(window)
{
int[] szImage = image.Size();
int byteSize = SizeOf(image);
ImageBuffer = Tag(new DataStream(byteSize, true, true));
foreach (Color4 color in image) { ImageBuffer.Write(color); }
Image = Tag(new Texture2D
(
Device3D,
CreateTextureDescription(szImage[0], szImage[1], Formats.Float4),
new DataRectangle(ImageBuffer.DataPointer, szImage[1] * SizeOf<Color4>())
));
SRV = Tag(new ShaderResourceView(Device3D, Image));
}