Platforms to show: All Mac Windows Linux Cross-Platform

PHImageManagerMBS class

Type Topic Plugin Version macOS Windows Linux Console & Web iOS
class Photos MBS Mac64bit Plugin 20.2 Yes No No Yes, macOS only No
Function: An object that facilitates retrieving or generating preview thumbnails and asset data.
Notes:
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.

Feedback, Comments & Corrections

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.

Use this content mode when requesting a full-sized image using the PHImageManagerMBS.MaximumSize value for the target size. In this case, the image manager does not scale or crop the image.

Sub classes:

Some examples which use this class:


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


PhidgetWeightSensorMBS   -   PHImageRequestOptionsMBS

The biggest plugin in space...




Links
MBS Xojo tutorial videos