SKTextureUtil.resizeTexture C# (CSharp) Метод

resizeTexture() приватный статический Метод

private static resizeTexture ( string pathToImage, int width, int height, string outputFilename ) : Texture2D
pathToImage string
width int
height int
outputFilename string
Результат UnityEngine.Texture2D
    private static Texture2D resizeTexture( string pathToImage, int width, int height, string outputFilename )
    {
        var args = string.Format( "-z {0} {1} {2} --out {3}", height, width, pathToImage, outputFilename );

        var proc = new System.Diagnostics.Process
        {
            StartInfo = new System.Diagnostics.ProcessStartInfo
            {
                FileName = "sips",
                Arguments = args,
                UseShellExecute = false,
                RedirectStandardOutput = true,
                CreateNoWindow = true
            }
        };

        proc.WaitForExit();
        proc.Start();

        while( !proc.StandardOutput.EndOfStream )
        {
            proc.StandardOutput.ReadLine();
        }

        var tex = new Texture2D( 0, 0 );
        tex.LoadImage( File.ReadAllBytes( outputFilename ) );
        File.Delete( outputFilename );

        return tex;
    }