public void Save(TextureFormat t, System.IO.Stream outFormatData) { PE3SimpleDATTexture texture = t as PE3SimpleDATTexture; if (texture == null) { throw new TextureFormatException("Not a valid PE3 Simple DAT Texture!"); } byte[] header = texture.GetRawHeader(); byte[] imageData = texture.GetImageData(); outFormatData.Write(header, 0, header.Length); outFormatData.Write(imageData, 0, imageData.Length); }
public void Export(TextureFormat t, MetadataWriter metadata, string directory, string basename) { PE3SimpleDATTexture texture = t as PE3SimpleDATTexture; if (texture == null) { throw new TextureFormatException("Not a valid PE3 Simple DAT Texture!"); } metadata.BeginSection("PE3SimpleDAT"); metadata.PutAttribute("Basename", basename); metadata.Put("RawHeader", texture.GetRawHeader()); texture.GetImage().Save(Path.Combine(directory, basename + ".png")); metadata.EndSection(); }