Я все еще делаю 60 изображений в формате GIF Размер 320 * 320. Обычно я использовал стороннюю библиотеку NSGIF на github, но все еще получаю предупреждение о сбое приложения и сбой при использовании 80 изображений для обработки изображений GIF.Сколько изображений Array для создания GIF-изображений в ios
NSDictionary *fileProperties = @{(__bridge id)kCGImagePropertyGIFDictionary: @{
(__bridge id)kCGImagePropertyGIFLoopCount: @0, // 0 means loop forever
}
};
NSDictionary *frameProperties = @{(__bridge id)kCGImagePropertyGIFDictionary: @{
//(__bridge id)kCGImagePropertyGIFDelayTime: @0.02f, // a float (not double!) in seconds, rounded to centiseconds in the GIF data
(__bridge id)kCGImagePropertyGIFDelayTime: @0.06f,
}
};
NSURL *documentsDirectoryURL = [[NSFileManager defaultManager] URLForDirectory:NSDocumentDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:YES error:nil];
NSString *savePath = [documentsDirectoryURL URLByAppendingPathComponent:@"animated.gif"];
CGImageDestinationRef destination = CGImageDestinationCreateWithURL((__bridge CFURLRef)savePath, kUTTypeGIF, FrameArr.count, NULL);
CGImageDestinationSetProperties(destination, (__bridge CFDictionaryRef)fileProperties);
for (NSUInteger i = 0; i < ImageArray.count; i++) {
@autoreleasepool {
UIImage *CaptureImage = [ImageArray objectAtIndex:i];
CGImageDestinationAddImage(destination, CaptureImage.CGImage, (__bridge CFDictionaryRef)frameProperties);
}
}
if (!CGImageDestinationFinalize(destination)) {
}
else
{
//[shareBtn setHidden:NO];
}
CFRelease(destination);
я хочу сделать 80 плюс изображения в GIF ..
Добавить код в свой вопрос. – KAR
почта какой-либо код пожалуйста. –