The image editing feature is added starting from SDK 4.7. You can select a desired image to add effects such as transition animation, background music, and stickers.The API functions are as follows:
- (int)setPictureList:(NSArray<UIImage *> *)pitureList fps:(int)fps;
- (void)setPictureTransition:(TXTransitionType)transitionType duration:(void(^)(CGFloat))duration;
typedef NS_ENUM(NSInteger, TXTransitionType) {
TXTransitionType_LefRightSlipping,
TXTransitionType_UpDownSlipping,
TXTransitionType_Enlarge,
TXTransitionType_Narrow,
TXTransitionType_RotationalScaling,
TXTransitionType_FadeinFadeout,
};
The setPictureList
API is used to set the image list, which must contain at least three images. If too many images are set, the image size should be appropriate to avoid editing exceptions due to high memory usage.
The setPictureTransition
API is used to set the transition effect. Currently, six effects are available, and their durations may vary. You can get the transition duration through duration
here.
Pay attention to the API call sequence: call setPictureList
first and then call setPictureTransition
.
Image editing currently does not support loop, reverse, fast/slow motions, and post-roll watermarking, but supports other video editing features. The call method is the same as that of video editing.