Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>With AVCapturePresets you have an explicit size that video or photos will be captured at. Once you take your photo, you can manipulate (crop, resize) to fit your desired size, but you cannot set a predetermined capture size.</p> <p>There are the acceptable presets:</p> <pre><code>NSString *const AVCaptureSessionPresetPhoto; NSString *const AVCaptureSessionPresetHigh; NSString *const AVCaptureSessionPresetMedium; NSString *const AVCaptureSessionPresetLow; NSString *const AVCaptureSessionPreset320x240; NSString *const AVCaptureSessionPreset352x288; NSString *const AVCaptureSessionPreset640x480; NSString *const AVCaptureSessionPreset960x540; NSString *const AVCaptureSessionPreset1280x720; </code></pre> <p>source: <a href="https://developer.apple.com/library/mac/#documentation/AVFoundation/Reference/AVCaptureSession_Class/Reference/Reference.html" rel="nofollow">https://developer.apple.com/library/mac/#documentation/AVFoundation/Reference/AVCaptureSession_Class/Reference/Reference.html</a></p> <p>This method is something I use that should help you scale to your desired size:</p> <pre><code>-(UIImage*)imageWithImage:(UIImage*)image scaledToSize:(CGSize)newSize; { UIGraphicsBeginImageContext( newSize ); [image drawInRect:CGRectMake(0,0,newSize.width,newSize.height)]; UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return newImage; } </code></pre> <p>Initializing session &amp; setting up preset:</p> <pre><code>// create a capture session if(session == nil){ session = [[AVCaptureSession alloc] init]; } if ([session canSetSessionPreset:AVCaptureSessionPreset320x240]) { session.sessionPreset = AVCaptureSessionPreset320x240; } else { NSLog(@"Cannot set session preset"); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload