AspectScaledToFillSizeWithRoundedCornersFilter

public struct AspectScaledToFillSizeWithRoundedCornersFilter : CompositeImageFilter

Scales an image from the center while maintaining the aspect ratio to fit within a specified size, then rounds the corners to the specified radius.

  • Initializes the AspectScaledToFillSizeWithRoundedCornersFilter instance with the given size and radius.

    Declaration

    Swift

    public init(size: CGSize, radius: CGFloat, divideRadiusByImageScale: Bool = false)

    Parameters

    size

    The size.

    radius

    The radius.

    divideRadiusByImageScale

    Whether to divide the radius by the image scale. Set to true when the image has the same resolution for all screen scales such as @1x, @2x and @3x (i.e. single image from web server). Set to false for images loaded from an asset catalog with varying resolutions for each screen scale. false by default.

    Return Value

    The new AspectScaledToFillSizeWithRoundedCornersFilter instance.

  • The image filters to apply to the image in sequential order.

    Declaration

    Swift

    public let filters: [ImageFilter]