---
title: "resizableImage(withCapInsets:resizingMode:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uiimage/resizableimage(withcapinsets:resizingmode:)"
---

# resizableImage(withCapInsets:resizingMode:)

Returns a new version of the image with the specified cap insets and options.

## Declaration

```swift
func resizableImage(withCapInsets capInsets: UIEdgeInsets, resizingMode: UIImage.ResizingMode) -> UIImage
```

## Parameters

- `capInsets`: The values to use for the cap insets.
- `resizingMode`: The mode with which the interior of the image is resized.

## Return Value

Return Value A new image object with the specified cap insets and resizing mode.

## Discussion

Discussion This method is exactly the same as its counterpart resizableImage(withCapInsets:) except that the resizing mode of the new image object can be explicitly declared. You should only call this method in place of its counterpart if you specifically want your image to be resized with the UIImage.ResizingMode.stretch resizing mode.

## See Also

### Changing the image attributes

- [withConfiguration(_:)](uikit/uiimage/withconfiguration(_:).md)
- [applyingSymbolConfiguration(_:)](uikit/uiimage/applyingsymbolconfiguration(_:).md)
- [imageFlippedForRightToLeftLayoutDirection()](uikit/uiimage/imageflippedforrighttoleftlayoutdirection().md)
- [withHorizontallyFlippedOrientation()](uikit/uiimage/withhorizontallyflippedorientation().md)
- [withRenderingMode(_:)](uikit/uiimage/withrenderingmode(_:).md)
- [withAlignmentRectInsets(_:)](uikit/uiimage/withalignmentrectinsets(_:).md)
- [resizableImage(withCapInsets:)](uikit/uiimage/resizableimage(withcapinsets:).md)
- [imageWithoutBaseline()](uikit/uiimage/imagewithoutbaseline().md)
- [withBaselineOffset(fromBottom:)](uikit/uiimage/withbaselineoffset(frombottom:).md)
- [UIImage.Configuration](uikit/uiimage/configuration-swift.class.md)
- [UIImage.SymbolConfiguration](uikit/uiimage/symbolconfiguration-swift.class.md)
