Ejemplo n.º 1
0
        /// <summary>
        ///   Saves a texture to file.
        /// </summary>
        /// <param name = "texture">The texture to save.</param>
        /// <param name = "format">The format the texture will be saved as.</param>
        /// <param name = "fileName">Name of the destination output file where the texture will be saved.</param>
        /// <returns>A <see cref = "T:SharpDX.Result" /> object describing the result of the operation.</returns>
        public static void ToFile <T>(T texture, ImageFileFormat format, string fileName)
            where T : Resource
        {
            System.Diagnostics.Debug.Assert(typeof(T) == typeof(Texture1D) || typeof(T) == typeof(Texture2D) ||
                                            typeof(T) == typeof(Texture3D));

            D3DX10.SaveTextureToFile(texture, format, fileName);
        }
Ejemplo n.º 2
0
 /// <summary>
 ///   Saves a texture to file.
 /// </summary>
 /// <param name = "texture">The texture to save.</param>
 /// <param name = "format">The format the texture will be saved as.</param>
 /// <param name = "fileName">Name of the destination output file where the texture will be saved.</param>
 /// <returns>A <see cref = "T:SharpDX.Result" /> object describing the result of the operation.</returns>
 public static void ToFile <T>(T texture, ImageFileFormat format, string fileName)
     where T : Resource
 {
     D3DX10.SaveTextureToFile(texture, format, fileName);
 }