Mac Developer Library

Developer

Quartz Framework Reference IKPictureTaker Class Reference

Options
Deployment Target:

On This Page
Language:

IKPictureTaker

Inheritance


Conforms To


Import Statement


Swift

import Quartz

Objective-C

@import Quartz;

Availability


Available in OS X v10.5 and later.

The IKPictureTaker class represents a panel that allows users to choose images by browsing the file system. The picture taker panel provides an Open Recent menu, supports image cropping, and supports taking snapshots from an iSight or other digital camera.

  • Returns a shared IKPictureTaker instance, creating it if necessary.

    Declaration

    Objective-C

    + (IKPictureTaker *)pictureTaker

    Return Value

    An IKPictureTaker object.

    Import Statement

    Objective-C

    @import Quartz;

    Availability

    Available in OS X v10.5 and later.

  • Opens a picture taker as a sheet whose parent is the specified window.

    Declaration

    Swift

    func beginPictureTakerSheetForWindow(_ aWindow: NSWindow!, withDelegate delegate: AnyObject!, didEndSelector didEndSelector: Selector, contextInfo contextInfo: UnsafeMutablePointer<Void>)

    Objective-C

    - (void)beginPictureTakerSheetForWindow:(NSWindow *)aWindow withDelegate:(id)delegate didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo

    Parameters

    aWindow

    The parent window of the picture taker sheet.

    delegate

    The object that will invoke the selector didEndSelector when the picture taker session terminates.

    didEndSelector

    The selector to invoke when the picture taker session terminates.

    contextInfo

    Any data that must be passed as an argument to the delegate through didEndSelector after the picture taker session terminates.

    Discussion

    The didEndSelector method should have the following signature:

    - (void)pictureTakerDidEnd:(IKPictureTaker *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo;

    The returnCode value is set to NSOKButton if the user validates, or to NSCancelButton if the user cancels.

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Opens a picture taker pane.

    Declaration

    Swift

    func beginPictureTakerWithDelegate(_ delegate: AnyObject!, didEndSelector didEndSelector: Selector, contextInfo contextInfo: UnsafeMutablePointer<Void>)

    Objective-C

    - (void)beginPictureTakerWithDelegate:(id)delegate didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo

    Parameters

    delegate

    The object that will invoke the selector didEndSelector when the picture taker session terminates.

    didEndSelector

    The selector to invoke when the picture taker session terminates.

    contextInfo

    Any data that must be passed as an argument to the delegate through didEndSelector after the picture taker session terminates.

    Discussion

    The didEndSelector method should have the following signature:

    - (void)pictureTakerDidEnd:(IKPictureTaker *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo;

    The returnCode value is set to NSOKButton if the user validates, or to NSCancelButton if the user cancels.

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Displays the Open Recent popup menu associated with the picture taker.

    Declaration

    Swift

    func popUpRecentsMenuForView(_ aView: NSView!, withDelegate delegate: AnyObject!, didEndSelector didEndSelector: Selector, contextInfo contextInfo: UnsafeMutablePointer<Void>)

    Objective-C

    - (void)popUpRecentsMenuForView:(NSView *)aView withDelegate:(id)delegate didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo

    Parameters

    delegate

    The object that will invoke the selector didEndSelector when the picture taker session terminates.

    didEndSelector

    The selector to invoke when the picture taker session terminates.

    contextInfo

    Any data that must be passed as an argument to the delegate through didEndSelector after the picture taker session terminates.

    Discussion

    The didEndSelector method should have the following signature:

    - (void)pictureTakerDidEnd:(IKPictureTaker *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo;

    The returnCode value is set to NSOKButton if the user validates, or to NSCancelButton if the user cancels.

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Opens a modal picture taker dialog.

    Declaration

    Swift

    func runModal() -> Int

    Objective-C

    - (NSInteger)runModal

    Return Value

    Returns NSOKButton if the user edits or chooses an image; NSCancelButton if the user cancels or does not change the default image.

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Set the image input for the picture taker.

    Declaration

    Swift

    func setInputImage(_ image: NSImage!)

    Objective-C

    - (void)setInputImage:(NSImage *)image

    Parameters

    image

    An NSImage object.

    Discussion

    The input image is never modified by the picture taker.

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.5 and later.

    See Also

    – inputImage

  • Returns the input image associated with the picture taker.

    Declaration

    Swift

    func inputImage() -> NSImage!

    Objective-C

    - (NSImage *)inputImage

    Return Value

    The input image.

    Discussion

    The input image is never modified by the picture taker.

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Returns the edited image.

    Declaration

    Swift

    func outputImage() -> NSImage!

    Objective-C

    - (NSImage *)outputImage

    Return Value

    The edited image.

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Controls whether the receiver enables video mirroring during snapshots.

    Declaration

    Swift

    func setMirroring(_ b: Bool)

    Objective-C

    - (void)setMirroring:(BOOL)b

    Parameters

    b

    The default setting is YEStrue.

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Returns whether video mirroring is enabled during snapshots.

    Declaration

    Swift

    func mirroring() -> Bool

    Objective-C

    - (BOOL)mirroring

    Return Value

    Returns YES if video mirroring is enabled, NO otherwise.

    Import Statement

    Objective-C

    @import Quartz;

    Swift

    import Quartz

    Availability

    Available in OS X v10.5 and later.

  • Keys for customizing the picture taker appearance and behavior. These values are set by sending the picture taker instance setValue:forKey.

    Declaration

    Swift

    let IKPictureTakerAllowsVideoCaptureKey: String let IKPictureTakerAllowsFileChoosingKey: String let IKPictureTakerUpdateRecentPictureKey: String let IKPictureTakerAllowsEditingKey: String let IKPictureTakerShowEffectsKey: String let IKPictureTakerInformationalTextKey: String let IKPictureTakerImageTransformsKey: String let IKPictureTakerOutputImageMaxSizeKey: String let IKPictureTakerShowAddressBookPictureKey: String let IKPictureTakerShowEmptyPictureKey: String let IKPictureTakerRemainOpenAfterValidateKey: String

    Objective-C

    NSString *const IKPictureTakerAllowsVideoCaptureKey; NSString *const IKPictureTakerAllowsFileChoosingKey; NSString *const IKPictureTakerShowRecentPictureKey; NSString *const IKPictureTakerUpdateRecentPictureKey; NSString *const IKPictureTakerAllowsEditingKey; NSString *const IKPictureTakerShowEffectsKey; NSString *const IKPictureTakerInformationalTextKey; NSString *const IKPictureTakerImageTransformsKey; NSString *const IKPictureTakerOutputImageMaxSizeKey; NSString *const IKPictureTakerCropAreaSizeKey; NSString *const IKPictureTakerShowAddressBookPictureKey; NSString *const IKPictureTakerShowEmptyPictureKey; NSString *const IKPictureTakerRemainOpenAfterValidateKey;

    Constants

    • IKPictureTakerAllowsVideoCaptureKey

      IKPictureTakerAllowsVideoCaptureKey

      A key for allowing video capture. The associated value is an NSNumber value (BOOL) whose default value is YEStrue.

      Available in OS X v10.5 and later.

    • IKPictureTakerAllowsFileChoosingKey

      IKPictureTakerAllowsFileChoosingKey

      A key for allowing the user to choose a file. The associated value is an NSNumber object that contains a BOOL value whose default value is YEStrue.

      Available in OS X v10.5 and later.

    • IKPictureTakerUpdateRecentPictureKey

      IKPictureTakerUpdateRecentPictureKey

      A key for allowing a recent picture to be updated. The associated value is an NSNumber object that contains a BOOL value whose default value is YEStrue.

      Available in OS X v10.5 and later.

    • IKPictureTakerAllowsEditingKey

      IKPictureTakerAllowsEditingKey

      A key for allowing image editing. The associated value is an NSNumber object that contains a BOOL value whose default value is YEStrue.

      Available in OS X v10.5 and later.

    • IKPictureTakerShowEffectsKey

      IKPictureTakerShowEffectsKey

      A key for showing effects. The associated value is an NSNumber object that contains a BOOL value whose default value is NOfalse.

      Available in OS X v10.5 and later.

    • IKPictureTakerInformationalTextKey

      IKPictureTakerInformationalTextKey

      A key for informational text. The associated value is an NSString or NSAttributedString object whose default value is "Drag Image Here".

      Available in OS X v10.5 and later.

    • IKPictureTakerImageTransformsKey

      IKPictureTakerImageTransformsKey

      A n image transformation key. The associated value is an NSDictionary object that can be serialized.

      Available in OS X v10.5 and later.

    • IKPictureTakerOutputImageMaxSizeKey

      IKPictureTakerOutputImageMaxSizeKey

      A key for the maximum size of the output image. The associated value is an NSValue object (NSSize).

      Available in OS X v10.5 and later.

    • IKPictureTakerCropAreaSizeKey

      IKPictureTakerCropAreaSizeKey

      A key for the cropping area size. The associated value is an NSValue object (NSSize).

      Available in OS X v10.5 and later.

      Deprecated in OS X v10.8.

    • IKPictureTakerShowAddressBookPictureKey

      IKPictureTakerShowAddressBookPictureKey

      A key for showing the address book picture. The associated value is a Boolean value packages as an NSNumber object. The default value is NOfalse. If set to YES, the picture taker automatically adds the address book image for the Me user at the end of the Recent Pictures pop-up menu.

      Available in OS X v10.5 and later.

    • IKPictureTakerShowEmptyPictureKey

      IKPictureTakerShowEmptyPictureKey

      A key for showing an empty picture. The associated value is an NSImage object. The default value is nil. If set to an image, the picture taker automatically shows an image at the end of the Recent Pictures pop-up menu. that means "no picture."

      Available in OS X v10.5 and later.

    • IKPictureTakerRemainOpenAfterValidateKey

      IKPictureTakerRemainOpenAfterValidateKey

      A key that determines if the picture taker should remain open after the user selects done. This allows the application to programmatically dismiss the panel. The associated value is an NSNumber object that contains a BOOL value whose default value is NOfalse

      Available in OS X v10.6 and later.