2017-04-08 1 views
1

이 카메라를 활성화 도움이되지만의 ViewController를 클릭 버튼을(SWIFT) 캡처 이미지 이미지를 캡처 할 수 없습니다 GPUIMAGE 2

var rendeView = RenderView() 
var filter = RGBAdjustment() 

override func viewDidLoad() { 
    rendeView = RenderView(frame: CGRect(x: 0, y: 179, width: UIScreen.main.bounds.size.width, height: UIScreen.main.bounds.size.height - 179)) 

    do { 
     var camera = try Camera(sessionPreset:AVCaptureSessionPreset640x480) 
     filter.red = 0.0 
     camera --> filter --> rendeView 
     camera.startCapture() 
     view.addSubview(rendeView) 
    } catch { 
     fatalError("Could not initialize rendering pipeline: \(error)") 
    } 
    view.bringSubview(toFront: takePhotobutton) 
    view.bringSubview(toFront: testimview) 
} 


@IBAction func takeApicture(_ sender: UIButton) 
{ 
    code? 

}


방법 캡처 이미지를 이미지를 저장하고 보여주지하시기 바랍니다 방법

답변

-1
@IBAction func takeApicture(_ sender: UIButton) 
{ 


let pictureOutput = PictureOutput() 
pictureOutput.encodedImageFormat = .JPEG 
pictureOutput.encodedImageAvailableCallback = {imageData in 

// Do something with the NSData 
//Convert this NSData to UIImage and place this image to your imageView to the next screen. 

} 
filter --> pictureOutput 
} 

희망이 있습니다.

+0

잘 모르면주의를 분산시키지 마십시오. –

관련 문제