Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Take Photo #26

Closed
geogerar opened this issue Sep 30, 2013 · 1 comment
Closed

Take Photo #26

geogerar opened this issue Sep 30, 2013 · 1 comment

Comments

@geogerar
Copy link

Hello again,

I would like to ask if you can tell me (write) how can i take photo....and write in a file.
I know how to set up the camera....but which methods do i call to shoot a photo.

Thanks a lot...

George N. Gerardis

@piemonte
Copy link
Owner

Hi George,

Here are some tips, I won't be able to offer you any help beyond this:

#pragma mark - UIButton

- (void)_handleCaptureButton:(UIButton *)button
{
#if (TARGET_IPHONE_SIMULATOR)

#else
    [[PBJVision sharedInstance] capturePhoto];
#endif
}

#pragma mark - PBJVisionDelegate

- (void)vision:(PBJVision *)vision capturedPhoto:(NSDictionary *)photoDict error:(NSError *)error
{
    if (error)
        return;

    _currentPhoto = photoDict;

    NSData *photoData = [_currentPhoto objectForKey:PBJVisionPhotoJPEGKey];
    NSDictionary *metadata = [_currentPhoto objectForKey:PBJVisionPhotoMetadataKey];

    // ALAssetsLibrary
    [_assetLibrary writeImageDataToSavedPhotosAlbum:photoData metadata:metadata completionBlock:nil];
}

Patrick

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants