GIF をアニメーション化された UIImage に変換する場合、各フレームの遅延はプロパティkCGImagePropertyGIFDelayTime
またはから抽出されます。kCGImagePropertyGIFUnclampedDelayTime
そのようです:
NSString *frameKeyPath = [NSString stringWithFormat:@"%@.%@",(NSString*)kCGImagePropertyGIFDictionary,kCGImagePropertyGIFUnclampedDelayTime];
CFDictionaryRef cfFrameProperties = CGImageSourceCopyPropertiesAtIndex(source,i,nil);
NSDictionary *frameProperties = (__bridge NSDictionary*)cfFrameProperties;
NSNumber *delayTimeProp = [frameProperties valueForKeyPath:frameKeyPath];
Chrome は両方の例で正しいものを選択します。
kCGImagePropertyGIFDelayTime
= 0.1 : http://i.imgur.com/tX9cjUO.gif
kCGImagePropertyGIFUnclampedDelayTime
= 0.01 : http://i.minus.com/iIOyK7SKp8TYc.gif
すべてのケースに 1 つを選択すると、例の画像のいずれかのアニメーションが遅すぎたり速すぎたりする結果になります
どのプロパティを使用するかを決定する方法はありますか?
ありがとう