ImageScript v4.0.0
    Preparing search index...

    Type AliasResizeToOptions

    ResizeToOptions: ResizeOptions & (
        | {
            background?: never;
            fit?: "fill"
            | "inside";
            height?: number;
            width?: number;
        }
        | { background?: Color; fit: "contain"; height: number; width: number }
        | { background?: never; fit: "cover"; height: number; width: number }
    )

    The size for Image.resize, Frame.resize and Animation.resize, and how to resize: a side that is missing follows from the other one, keeping the aspect ratio

    Type Declaration

    • { background?: never; fit?: "fill" | "inside"; height?: number; width?: number }
      • Optionalbackground?: never

        Only with fit: 'contain'

      • Optionalfit?: "fill" | "inside"

        'fill' stretches to the exact size; 'inside' keeps the aspect ratio and makes the image as large as fits inside it, so one side can be smaller

        'fill'

      • Optionalheight?: number

        The new height. Without it, it follows from the width

      • Optionalwidth?: number

        The new width. Without it, it follows from the height

    • { background?: Color; fit: "contain"; height: number; width: number }
      • Optionalbackground?: Color

        For 'contain', the color of the bars

        0x00000000 (transparent)

      • fit: "contain"

        Keeps the aspect ratio and pads to the exact box

      • height: number

        The exact height of the box

      • width: number

        The exact width of the box

    • { background?: never; fit: "cover"; height: number; width: number }
      • Optionalbackground?: never

        Only with fit: 'contain'

      • fit: "cover"

        Keeps the aspect ratio and crops to the exact box

      • height: number

        The exact height of the box

      • width: number

        The exact width of the box