```{index} single: stride_for_width (Cairo::Format) ``` ```{index} single: Cairo::Format::stride_for_width ``` # stride_for_width Returns the number of bytes one row of pixels occupies for a given format and width - the `$stride` that `create_for_data` wants. my $stride = Cairo::Format::stride_for_width('argb32', $width); Called as a plain FUNCTION, not as a method: write `Cairo::Format::stride_for_width(...)`, not `Cairo::Format->stride_for_width(...)`. The result is usually more than width times bytes-per-pixel, because rows are padded for alignment. Returns a negative number for a format or width cairo cannot handle. Wraps `cairo_format_stride_for_width`.