<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: 10.0.0 - 10.6.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSImage/setScalesWhenResized:",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSImage(im)setScalesWhenResized:"
  },
  "title" : "setScalesWhenResized:"
}
-->

# setScalesWhenResized:

Sets whether to scale different-sized image representations to fit the image’s size.

```
- (void) setScalesWhenResized:(BOOL) flag;
```

## Parameters

`flag`

<doc://com.apple.documentation/documentation/Swift/true> if image representations are scaled to fit; otherwise <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

Most images (especially those loaded from files and URLs) contain only a single image representation whose size is the same as the receiver. It is possible to add image representations using the [`addRepresentation(_:)`](/documentation/AppKit/NSImage/addRepresentation(_:)) or [`addRepresentations(_:)`](/documentation/AppKit/NSImage/addRepresentations(_:)) methods but doing so is rarely necessary because modern hardware is powerful enough to resize and scale images quickly. The only reason to consider creating new representations is if each representations contains a customized version of the image at a specific size. (TIFF images may also contain a thumbnail version of an image, which is stored using a separate image representation.) If you pass <doc://com.apple.documentation/documentation/Swift/true> in the `flag` parameter, and subsequently assign a new value to the [`size`](/documentation/AppKit/NSImage/size) property, all such image representations would be scaled to the same size. Scaling of bitmap images usually results in the interpolation of the bitmap data.

This method does not invalidate the caches of any of the receiver’s image representations. The caches are not invalidated until you change the image size using the [`size`](/documentation/AppKit/NSImage/size) property. Scaling affects only the cached offscreen data for a given image representation.

## See Also

[`- (BOOL) scalesWhenResized;`](/documentation/AppKit/NSImage/scalesWhenResized)

Returns a Boolean value that indicates whether to scale image representations to fit the image’s size.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)