1
我想從沒有音頻文件的png圖像創建視頻。iPhone:從圖像創建視頻
我已經實現了下面的代碼,但我的圖像運行不順暢。
- (void)viewDidLoad
{
totalImages = 121;
counter=1;
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
-(void)viewDidAppear:(BOOL)animated
{
levelTimer = [NSTimer scheduledTimerWithTimeInterval:0.40 target: self selector: @selector(levelTimerCallback:) userInfo: nil repeats: YES];
}
- (void)levelTimerCallback:(NSTimer *)timer
{
if(counter <= totalImages)
{
NSString *fileName = [NSString stringWithFormat:@"image_iphone_%d",counter];
NSLog(@"filenameEasy:%@",fileName);
NSString *fileLocation = [[NSBundle mainBundle] pathForResource:fileName ofType:@"png"];
UIImage *imageName = [[UIImage alloc] initWithContentsOfFile:fileLocation];
imgV.image = imageName;
counter++;
NSLog(@"counter:%d",counter);
[imageName release];
[self viewDidAppear:NO];
}
}
如果您有任何想法請分享它。 thanx提前。