示例#1
0
 protected DDSImage GetDDS()
 {
     if (Chunk == null)
     {
         return null;
     }
     else
     {
         DDSImage image = new DDSImage(Chunk.Chunks["DATA"].Data);
         _Width = image.Width;
         _Height = image.Height;
         _IsLossless = image.IsARGB32;
         _HasAlpha = image.HasAlpha;
         _HasBitmap = image.HasBitmap;
         return image;
     }
 }
示例#2
0
        public static void SaveDDS(string filename, DDSImage image, DateTime ModTime)
        {
            string dir = Path.GetDirectoryName(filename);
            if (!Directory.Exists(dir))
            {
                Directory.CreateDirectory(dir);
            }

            using (Stream outfile = File.Create(filename))
            {
                image.Data.CopyTo(outfile);
            }
            File.SetLastWriteTimeUtc(filename, ModTime);
        }