dmitric / DLCImagePickerController

ImagePickerController with live filters, radial blur and more. Brought to you by Backspaces.
www.backspac.es
BSD 3-Clause "New" or "Revised" License
1.56k stars 320 forks source link

Having difficulties with using images #38

Open MattW86 opened 11 years ago

MattW86 commented 11 years ago

Hello,

I am having difficulties to use images within the DLCImagePickerController. For example I am trying to add an image to filtersBackgroundImageView. There is no image showing. Can you please help me? Thanks..

    GPUImageOutput<GPUImageInput> *processUpTo;

    if (hasBlur) {
        processUpTo = blurFilter;
    } else {
        processUpTo = filter;
    }

    [staticPicture processImage];

    UIImage *currentFilteredVideoFrame = [processUpTo imageFromCurrentlyProcessedOutputWithOrientation:staticPictureOriginalOrientation];

    UIImageView *iv = [[UIImageView alloc] initWithFrame:CGRectMake(3, 3, 10, 10)];
    iv.image = [UIImage imageWithData:UIImageJPEGRepresentation(currentFilteredVideoFrame, self.outputJPEGQuality)];
    [self.filtersBackgroundImageView addSubview:iv];

    NSDictionary *info = [[NSDictionary alloc] initWithObjectsAndKeys:
                          UIImageJPEGRepresentation(currentFilteredVideoFrame, self.outputJPEGQuality), @"data", nil];
    [self.delegate imagePickerController:self didFinishPickingMediaWithInfo:info];