【问题标题】:iOS:How to change the pictures in a video?iOS:如何更改视频中的图片?
【发布时间】:2013-02-27 07:08:15
【问题描述】:

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

【问题讨论】:

标签: ios video uiimage avfoundation


【解决方案1】:

例如,将您的图像名称设为 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];

【讨论】:

  • 谢谢,但我想将 UIImageView 制作成视频..如何制作视频?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多