roundedRectangleStrokeGenerator()
Creates an image containing the outline of a rounded rectangle.
Declaration
class func roundedRectangleStrokeGenerator() -> any CIFilter & CIRoundedRectangleStrokeGeneratorReturn Value
A CIImage containing the stroked rectangle.
Discussion
This filter creates an outline of a rounded rectangle.
The filter takes the following properties:
extentA CGRect containing the position and size of the rectangle.
widthThe width of the stroke to draw.
radiusThe corner radius.
The following code generates an image containing a stroked rounded rectangle:
func roundedRectangleStroke() -> CIImage {
let filter = CIFilter.roundedRectangleStrokeGenerator()
filter.extent = CGRect(x: 0, y: 0, width: 200, height: 100)
filter.color = CIColor.red
filter.width = 5
filter.radius = 20
return filter.outputImage!
}[Image]
See Also
Filters
attributedTextImageGenerator()aztecCodeGenerator()barcodeGenerator()blurredRectangleGenerator()checkerboardGenerator()code128BarcodeGenerator()lenticularHaloGenerator()meshGenerator()pdf417BarcodeGenerator()qrCodeGenerator()randomGenerator()roundedRectangleGenerator()starShineGenerator()stripesGenerator()sunbeamsGenerator()