/// <summary> /// Saves the encoded palette to the specified stream. /// </summary> /// <param name="destination">The stream to save the texture to.</param> public void Save(Stream destination) { MemoryStream paletteStream = EncodePalette(); paletteStream.Position = 0; PTStream.CopyTo(paletteStream, destination); }
public VrTextureEncoder(Stream source, int length) { MemoryStream buffer = new MemoryStream(); PTStream.CopyPartTo(source, buffer, length); Initalize(new Bitmap(buffer)); }
/// <summary> /// Saves the encoded palette to the specified path. /// </summary> /// <param name="path">Name of the file to save the data to.</param> public void Save(string path) { using (FileStream destination = File.Create(path)) { MemoryStream paletteStream = EncodePalette(); paletteStream.Position = 0; PTStream.CopyTo(paletteStream, destination); } }
/// <summary> /// Saves the encoded texture to the specified stream. /// </summary> /// <param name="destination">The stream to save the texture to.</param> public void Save(Stream destination) { if (!initalized) { throw new TextureNotInitalizedException("Cannot encode this texture as it is not initalized."); } MemoryStream textureStream = EncodeTexture(); textureStream.Position = 0; PTStream.CopyTo(textureStream, destination); }
/// <summary> /// Saves the encoded texture to the specified path. /// </summary> /// <param name="path">Name of the file to save the data to.</param> public void Save(string path) { if (!initalized) { throw new TextureNotInitalizedException("Cannot encode this texture as it is not initalized."); } using (FileStream destination = File.Create(path)) { MemoryStream textureStream = EncodeTexture(); textureStream.Position = 0; PTStream.CopyTo(textureStream, destination); } }