【发布时间】:2013-02-27 07:08:15
【问题描述】:
我需要把图片转成动画视频,但是不知道怎么做视频,不知道有什么好的方法?
【问题讨论】:
-
它们被称为“框架”,而不是“图片”。
标签: ios video uiimage avfoundation
我需要把图片转成动画视频,但是不知道怎么做视频,不知道有什么好的方法?
【问题讨论】:
标签: ios video uiimage avfoundation
例如,将您的图像名称设为 xxxx-1.png、xxxx-2.png ...... xxxx-80.png。并粘贴下面的代码。然后图像将像视频一样动画。
NSMutableArray* imgArray = [[NSMutableArray alloc] init];
for (int i=1; i <= 80; i++) {
[imgArray addObject:[UIImage imageNamed:[NSString stringWithFormat:@"xxxx-%d.png",i]]];
}
UIImageView* imgView = [UIImageView alloc] initWithFrame:(x,y,a,b)];
imgView.animationImages = imgArray;
imgView.animationDuration = 0.25;
imgView.animationRepeatCount = 0;
[imgView startAnimating];
[self.view addSubview:imgView];
[imgView release];
【讨论】: