GPUImageUIElement - > GPUImageView不起作用

时间:2014-11-11 12:22:45

标签: objective-c gpuimage

我正在尝试捕捉全屏视频,但首先想拍摄一些简单的视图。从UIView获取图像并在视图下方生成。这是我的代码:

- (void)viewDidLoad {
    [super viewDidLoad];

    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(100, 100, 100, 100)];
    label.text = @"fds";
    [self.view addSubview:label];

    handleUiElem = [[GPUImageUIElement alloc] initWithView:label];

    CGRect frame = label.frame;
    frame.origin.y += 100;
    outView = [[GPUImageView alloc] initWithFrame:frame];
    outView.backgroundColor = [UIColor redColor];
    [self.view addSubview:outView];

    [handleUiElem addTarget:outView];
    [[NSTimer scheduledTimerWithTimeInterval:0.2 target:self selector:@selector(update:) userInfo:nil repeats:YES] fire];
}

- (void)update:(id)timer
{
    [handleUiElem updateUsingCurrentTime];
}

但结果是我得到黑色视图而不是标签中的文字。我做错了什么? enter image description here

0 个答案:

没有答案