PictureTests SaveAndLoad Method Delta Engine Documentation

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

public void SaveAndLoad()
Examples

[Test, CloseAfterFirstFrame]
public void SaveAndLoad()
{
    var stream = BinaryDataExtensions.SaveToMemoryStream(picture);
    var loadedPicture = (Picture)stream.CreateFromMemoryStream();
    Assert.AreEqual("DeltaEngineLogo", loadedPicture.Material.DiffuseMap.Name);
    Assert.AreEqual("DeltaEngineLogo", loadedPicture.Get<Theme>().SliderPointer.DiffuseMap.Name);
    Assert.AreEqual(Rectangle.HalfCentered, loadedPicture.DrawArea);
}
See Also