ScreenshotSettings.getBoundedDimensions C# (CSharp) Метод

getBoundedDimensions() публичный Метод

public getBoundedDimensions ( int width, int height, int &bounded_w, int &bounded_h ) : void
width int
height int
bounded_w int
bounded_h int
Результат void
    public void getBoundedDimensions(int width, int height, ref int bounded_w, ref int bounded_h)
    {
        float aspect = (float)width / (float)height;

        if (aspect > IDEAL_ASPECT_RATIO)
        {
            //Wider than ideal aspect ratio
            bounded_w = maxWidth;
            bounded_h = Math.Min(maxHeight, (int)Math.Round(maxWidth / aspect));
        }
        else
        {
            //Taller than ideal aspect ratio
            bounded_h = maxHeight;
            bounded_w = Math.Min(maxWidth, (int)Math.Round(maxHeight * aspect));
        }
    }