Exemple #1
0
        public static string Upscale(string path)
        {
            using (var image = DirectXTex.LoadFromDDSFile(path)) {
                var meta   = image.MetaData;
                var newImg = image.Resize(CeilPowerOfTwo(meta.Width), CeilPowerOfTwo(meta.Height), true);
                path = GetUpscaledName(path);
                newImg.SaveToDDS(path);
            }

            return(path);
        }
        public void DirectXTex_GetMetadataFromDDSTest()
        {
            const string k_filename =
                @"U:\Ensemble\HaloWars\Content\1.11088.1.2\" +
                @"art\unsc\infantry\spartan_01\" +
                @"spartan_01_nm.ddx";

            var metadata = DirectXTex.GetMetadataFromFile(k_filename);

            Assert.IsTrue(DirectXTexDLL.Initialized);
            Assert.IsFalse(DirectXTexDLL.EntryPointsNotFound);

            Console.WriteLine(metadata.Width);
            Console.WriteLine(metadata.Height);
            Console.WriteLine(metadata.Format);

            DirectXTexDLL.Dispose();
        }