ImageTests FillCustomImageWitDifferentSizeThanImageCausesException 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 FillCustomImageWitDifferentSizeThanImageCausesException()
Examples

[Test, CloseAfterFirstFrame]
public void FillCustomImageWitDifferentSizeThanImageCausesException()
{
    var customImage = ContentLoader.Create<Image>(new ImageCreationData(new Size(8, 9)));
    var colors = new Color[8 * 8];            
    Assert.Throws<Image.InvalidNumberOfColors>(() => customImage.Fill(colors));
    var byteArray = new byte[8 * 8];
    Assert.Throws<Image.InvalidNumberOfBytes>(() => customImage.FillRgbaData(byteArray));
    var goodByteArray = new byte[8 * 9 * 4];
    customImage.FillRgbaData(goodByteArray);
}
See Also