示例#1
0
        /// <summary>
        /// Gets a palette from a TileLayer palette
        /// </summary>
        /// <param name="Filepath">Location of the savestate file</param>
        /// <returns>Standard color palette</returns>
        public static ColorPalette From_TilelayerPalette(string Filepath)
        {
            if (string.IsNullOrEmpty(Filepath))
            {
                throw new ArgumentException("Invalid filepath");
            }
            var converter = new PaletteConverters.TileLayerPro();

            return(converter.GetPalette(System.IO.File.ReadAllBytes(Filepath)));
        }
示例#2
0
        /// <summary>
        /// Gets a palette from a TileLayer palette
        /// </summary>
        /// <param name="DataStream">Stream containing the palette data</param>
        /// <returns>Standard color palette</returns>
        public static ColorPalette From_TilelayerPalette(Stream DataStream)
        {
            if (DataStream == null)
            {
                throw new ArgumentNullException();
            }
            var converter = new PaletteConverters.TileLayerPro();
            var alldata   = new byte[DataStream.Length];

            DataStream.Read(alldata, 0, alldata.Length);
            return(converter.GetPalette(alldata));
        }
示例#3
0
 /// <summary>
 /// Gets a palette from a TileLayer palette
 /// </summary>
 /// <param name="DataStream">Stream containing the palette data</param>
 /// <returns>Standard color palette</returns>
 public static ColorPalette From_TilelayerPalette(Stream DataStream)
 {
     if (DataStream == null) throw new ArgumentNullException();
     var converter = new PaletteConverters.TileLayerPro();
     var alldata = new byte[DataStream.Length];
     DataStream.Read(alldata, 0, alldata.Length);
     return converter.GetPalette(alldata);
 }
示例#4
0
 /// <summary>
 /// Gets a palette from a TileLayer palette
 /// </summary>
 /// <param name="Filepath">Location of the savestate file</param>
 /// <returns>Standard color palette</returns>
 public static ColorPalette From_TilelayerPalette(string Filepath)
 {
     if (string.IsNullOrEmpty(Filepath)) throw new ArgumentException("Invalid filepath");
     var converter = new PaletteConverters.TileLayerPro();
     return converter.GetPalette(System.IO.File.ReadAllBytes(Filepath));
 }