Graphics Reference
In-Depth Information
When you run the Photo Capture application, the view on the left displays the
QTCaptureLayer
in an
NSView
. When you click the Capture Image button, the view on the
right updates by snagging the current image from the capture layer. When you set the
image on the image view, it simply displays the image in its frame. If you want to save
the image, you would obtain an
NSData
object by calling
-representationUsingType
on
the
NSImage
. When you have this
NSData
object, you can then call
-writeToFile:
atomically:
to write the file to disk.
The QuickTime Core Animation layers provide some powerful functionality both for
displaying movies on disk and for real-time video display using a variety of supported
capture devices. They make these complicated tasks almost trivial to implement in your
own video applications.