ImageTests DrawCustomImageFromBytes Method Delta Engine Documentation

Namespace: DeltaEngine.Graphics.Tests
Assembly: DeltaEngine.Graphics.Tests (in DeltaEngine.Graphics.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void DrawCustomImageFromBytes()
Examples

[Test, ApproveFirstFrameScreenshot]
public void DrawCustomImageFromBytes()
{
    var customImage = ContentLoader.Create<Image>(new ImageCreationData(new Size(8, 8)));
    var bytes = new byte[8 * 8 * 4];
    var color = Color.Purple;
    for (int i = 0; i < 8 * 8; i++)
    {
        bytes[i * 4] = color.R;
        bytes[i * 4 + 1] = color.G;
        bytes[i * 4 + 2] = color.B;
    }
    customImage.FillRgbaData(bytes);
    new SolidSprite(customImage);
}
See Also