开发者

Saving data with dataWithPDFInsideRect: just makes a black pdf

开发者 https://www.devze.com 2023-01-09 22:24 出处:网络
I have a QTCaptureView and Im trying to save the view as a picture. So far I have this: NSRect rect = [outputView bounds];

I have a QTCaptureView and Im trying to save the view as a picture. So far I have this:

 NSRect rect = [outputView bounds];
 NSData *viewData = [outputView dataWithPDFInsideRect:rect];
 [viewData writeToFile:@"/test.pdf" atomically:YES];

but fo开发者_开发百科r some reason when I save instead of seeing a picture of my vie (iSight Camera) I see a black pdf file.

Thanks for any help


QTCaptureView isn't meant to be used in this way due to the way it is optimized. You'll need to do single-frame-grabbing the QTKit way: Creating a Single-Frame Grabbing Application.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号