Exemple #1
0
 public override byte[] ConvertToByte(Sprite entity)
 {
     using (var ms = new MemoryStream()) {
         Npks.WriteImage(ms, entity);
         return(ms.ToArray());
     }
 }
        public override byte[] ConvertToByte(Sprite entity)
        {
            if (entity.Compress == Compress.ZLIB && entity.Type < ColorBits.LINK)
            {
                using (var ms = new MemoryStream()){
                    Npks.WriteImage(ms, entity);
                    return(ms.ToArray());
                }
            }
            var dds = DDS.CreateFromBitmap(entity.Picture, entity.Compress);

            Map[entity] = new DDS_Info()
            {
                DDS       = dds,
                RightDown = new Point(entity.Width, entity.Height)
            };
            return(dds.Data);
        }