---
title: CPNowPlayingImageButton
framework: carplay
role: symbol
role_heading: Class
path: carplay/cpnowplayingimagebutton
---

# CPNowPlayingImageButton

A button that displays an image.

## Declaration

```swift
@MainActor class CPNowPlayingImageButton
```

## Overview

Overview CPNowPlayingImageButton is a concrete subclass of CPNowPlayingButton. Use this class when you want to display a button that contains an image. In iOS 17 and later, CarPlay retints the custom now playing image buttons your app provides; you need to provide images  as monocolor assets. CarPlay doesn’t support animated images. If you provide an animated image, CarPlay uses only the first image in the animation sequence. To properly size your image, use the display scale of the vehicle’s primary screen—see your interface controller’s carTraitCollection property—and make sure it is no larger than CPNowPlayingButtonMaximumImageSize.

## Topics

### Creating a Button

- [init(image:handler:)](carplay/cpnowplayingimagebutton/init(image:handler:).md)
- [CPNowPlayingButtonMaximumImageSize](carplay/cpnowplayingbuttonmaximumimagesize.md)

### Getting the Button’s Image

- [image](carplay/cpnowplayingimagebutton/image.md)

## Relationships

### Inherits From

- [CPNowPlayingButton](carplay/cpnowplayingbutton.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Managing the Template’s Buttons

- [nowPlayingButtons](carplay/cpnowplayingtemplate/nowplayingbuttons.md)
- [updateNowPlayingButtons(_:)](carplay/cpnowplayingtemplate/updatenowplayingbuttons(_:).md)
- [CPNowPlayingButton](carplay/cpnowplayingbutton.md)
- [CPNowPlayingAddToLibraryButton](carplay/cpnowplayingaddtolibrarybutton.md)
- [CPNowPlayingMoreButton](carplay/cpnowplayingmorebutton.md)
- [CPNowPlayingPlaybackRateButton](carplay/cpnowplayingplaybackratebutton.md)
- [CPNowPlayingRepeatButton](carplay/cpnowplayingrepeatbutton.md)
- [CPNowPlayingShuffleButton](carplay/cpnowplayingshufflebutton.md)
