0
使用QTKit
框架之前縮放QTMovie,我正在開發一個小應用程序。附加
在應用程序中,我嘗試了其他影片,這在本質上已經工作(大部分時間)後追加一個電影,但我在使用附加的電影有點麻煩。我追加的電影非常大,比如1920x1080,附加的電影通常要小得多,但我永遠不知道它的大小。附加的電影排序保持其自己的大小在以前的1920x1080幀,如下所示:
有沒有人熟悉這個?有沒有一種方法可以將我需要追加的電影縮放到附加電影的大小?文檔中沒有提及這樣的事情。
這是一些相關的方法: `QTMovie * segmentTwo = [QTMovie movieWithURL:finishedMovie error:nil]; QTTimeRange範圍= {。時間= QTZeroTime,.duration = [segmentTwo持續時間]};
[segmentTwo setSelection:range];
[leader appendSelectionFromMovie:segmentTwo];
while([[leader attributeForKey:QTMovieLoadStateAttribute] longValue] != 100000L)
{
//wait until QTMovieLoadStateComplete
}
NSDictionary *exportAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:YES], QTMovieExport,
[NSNumber numberWithLong:kQTFileTypeMovie], QTMovieExportType, nil];
NSString *outputFile = [NSString stringWithFormat:@"%@.mov", onderwerp];
NSString *filepath = [[@"~/Desktop" stringByExpandingTildeInPath] stringByAppendingFormat:@"/%@", outputFile];
BOOL succes = [leader writeToFile:filepath withAttributes:exportAttributes error:&theError];
領袖被初始化這樣的:
NSDictionary *movieAttributes = [NSDictionary dictionaryWithObjectsAndKeys:path, QTMovieFileNameAttribute, [NSNumber numberWithBool:YES], QTMovieEditableAttribute, nil];
leader = [QTMovie movieWithAttributes: movieAttributes error:&error];