0

想把图片改成动画视频,但是不知道怎么做视频,不知道有什么好的方法?

4

1 回答 1

0

例如,将您的图像名称设为 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];
于 2013-02-27T07:18:19.650 回答