```{index} single: create_for_rectangle (Cairo::Surface) ``` ```{index} single: Cairo::Surface::create_for_rectangle ``` # create_for_rectangle Creates a surface that is a window onto part of another one. my $part = Cairo::Surface->create_for_rectangle( $target, $x, $y, $width, $height); Drawing on the result goes through to `$target`, clipped to the given rectangle and with its origin moved to the rectangle's corner. The coordinates are in `$target`'s device space and need not be whole pixels. `$target` is kept alive by the returned surface. Wraps `cairo_surface_create_for_rectangle`.