2

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 for 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

nosedive25
  • 2,477
  • 5
  • 30
  • 45
  • There's no point in using `dataWithPDFInsideRect:` for that, since the view isn't drawing any vectors. You want a raster capture here. – Peter Hosey Jul 31 '10 at 19:41

1 Answers1

2

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.

Joshua Nozzi
  • 60,946
  • 14
  • 140
  • 135