Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Iulius is correct that this is essentially a duplicate question. However, just to rule out one issue-- would you like the user to be able to see the overlay while composing the shot? (i.e. if your app makes different hats appear on people's heads, do you want to show the hat floating in space while they take the photo?). If you want to learn more about that, you'll need to use the cameraOverlayView property of the imagePickerController, which lets you superimpose your own view(s) on the camera. There are questions on this topic already on SO, like this one: <a href="https://stackoverflow.com/questions/5618365/how-to-add-a-overlay-view-to-the-cameraview-and-save-it">How to add a overlay view to the cameraview and save it</a></p> <p><strong>Update re: scaling</strong>-- LilMoke, I assume when you say that the image is offset you're getting into trouble with the difference with the camera's aspect ratio (4:3) and the screen of the iPhone (3:4). You can define a constant and use it to set the cameraViewTransform property of your UIImagePickerController. Here's a code snippet, partially borrowed, and simplified from the excellent augmented reality tutorial <a href="http://www.raywenderlich.com/3997/introduction-to-augmented-reality-on-the-iphone" rel="nofollow noreferrer">at raywenderlich.com</a>:</p> <pre><code>#define CAMERA_TRANSFORM 1.24299 // First create an overlay view for your superimposed image overlay = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; overlay.backgroundColor=[UIColor clearColor]; overlay.opaque = NO; UIImagePickerController *imagePicker; imagePicker = [[[UIImagePickerController alloc] init] autorelease]; imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; imagePicker.showsCameraControls = YES; // assuming you need these? imagePicker.toolbarHidden = YES; imagePicker.navigationBarHidden = YES; imagePicker.wantsFullScreenLayout = YES; imagePicker.cameraViewTransform = CGAffineTransformScale(imagePicker.cameraViewTransform, CAMERA_TRANSFORM, CAMERA_TRANSFORM); // If I understood your problem, this should help imagePicker.cameraOverlayView = overlay; </code></pre> <p>If code along these lines doesn't get you on track, then maybe you can post all the relevant code from your troubled project here. Hopefully it's just a matter of setting the cameraViewTransform as I said above.</p>
    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.
 

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