Platforms to show: All Mac Windows Linux Cross-Platform

PHImageManagerMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Photos MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
An object that facilitates retrieving or generating preview thumbnails and asset data.

Use these methods to fetch full-size photo assets or thumbnail images, or to retrieve AVFoundation objects for playing, exporting, and manipulating video assets.

To load image or video data:
1. Use the PHAsset class to fetch the asset you’re interested in.
2. Call the defaultManager method to retrieve the shared image manager object.
3. Use one of the methods listed in Requesting Images and Requesting Video Objects to load the asset’s image or video data.

The image manager caches the asset images and data it provides, so later requests for the same assets with similar parameters will return results more quickly.

If you need to load image data for many assets together, use the PHCachingImageManagerMBS class to “preheat” the cache by loading images you expect to need soon. For example, when populating a collection view with photo asset thumbnails, you can cache images ahead of the current scroll position.

Available in MacOS 10.13 or later.

Constants

Constant Value Description
PHInvalidImageRequestID 0 A special value provided for asynchronous image requests that cannot be canceled.

Content Modes

Constant Value Description
ContentModeAspectFill 1 Scales the image so that it completely fills the target size.
ContentModeAspectFit 0 Scales the image so that its larger dimension fits the target size.
ContentModeDefault 0 Fits the image to the requested size using the default option, PHImageContentModeAspectFit. more

Sub classes:

Some examples using this class:

Blog Entries


The items on this page are in the following plugins: MBS Mac64bit Plugin.


PhidgetVoltageRatioInputMBS   -   PHImageRequestOptionsMBS


The biggest plugin in space...