MPMediaItemArtwork Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/MediaPlayer.framework
Availability
Available in iOS 3.0 and later.
Companion guide
Declared in
MPMediaItem.h
Related sample code

Overview

An MPMediaItemArtwork object, or media item artwork, represents a graphical image, such as music album cover art, associated with a media item. Media items are described in MPMediaItem Class Reference.

Tasks

Using a Media Item Image

Properties

bounds

The overall bounds, in points, of the image associated with the media item artwork.

@property (nonatomic, readonly) CGRect bounds
Availability
  • Available in iOS 3.0 and later.
Declared In
MPMediaItem.h

imageCropRect

The bounds, in points, of the content area for the full size image associated with the media item artwork.

@property (nonatomic, readonly) CGRect imageCropRect
Availability
  • Available in iOS 3.0 and later.
Declared In
MPMediaItem.h

Instance Methods

imageWithSize:

Creates and returns a UIImage object of a specified size.

- (UIImage *)imageWithSize:(CGSize)size
Parameters
size

The size, in points, for the new UIImage object.

Availability
  • Available in iOS 3.0 and later.
Related Sample Code
Declared In
MPMediaItem.h

initWithImage:

Initializes a media item artwork instance with a full-size image.

- (id)initWithImage:(UIImage *)image
Parameters
image

The image to use to initialize the media item artwork instance.

Discussion

This method assumes that the crop rectangle of the image matches the bounds of the image, as defined by the image’s size in points. That is, this method assumes the image you supply is tightly cropped.

Availability
  • Available in iOS 5.0 and later.
Declared In
MPMediaItem.h