Note that there are some explanatory texts on larger screens.

plurals
  1. POcamera overlay picture
    primarykey
    data
    text
    <p><strong>edit 3</strong></p> <p>Good news and bad news. The good news is that in the Connections Inspector by disconnecting the overlay UIToolbar and connecting the UIImageview, I see <code>theKing</code>, but then -- the bad news -- I do not see the UIToolbar, which I also need. So the question now is, how can the user get back to the calling VC when s/he is finished here? How can both the toolbar and the image be part of the the overlay, or can the "go back button" toolbar be on the non-overlay view, or something? Or how can I make both the toolbar and the image show on the OverlayViewController?</p> <p><strong>edit 3</strong></p> <p><strong>edit 2</strong></p> <p><code>setupImagePicker</code> in <code>OverlayViewController.m</code>.</p> <pre><code>- (void)setupImagePicker:(UIImagePickerControllerSourceType)sourceType { self.imagePickerController.sourceType = sourceType; if (sourceType == UIImagePickerControllerSourceTypeCamera) { // user wants to use the camera interface // self.imagePickerController.showsCameraControls = NO; if ([[self.imagePickerController.cameraOverlayView subviews] count] == 0) { // setup our custom overlay view for the camera // // ensure that our custom view's frame fits within the parent frame CGRect overlayViewFrame = self.imagePickerController.cameraOverlayView.frame; CGRect newFrame = CGRectMake(0.0, CGRectGetHeight(overlayViewFrame) - self.view.frame.size.height - 10.0, CGRectGetWidth(overlayViewFrame), self.view.frame.size.height + 10.0); self.view.frame = newFrame; [self.imagePickerController.cameraOverlayView addSubview:self.view]; } } } </code></pre> <p><strong>edit 2</strong></p> <p><strong>edit 1</strong></p> <p><a href="http://developer.apple.com/library/ios/samplecode/PhotoPicker/PhotoPicker.zip" rel="nofollow noreferrer">This is the PhotoPicker sample code link</a>.</p> <p><strong>edit 1</strong></p> <p><strong>edit 0</strong></p> <p>Has anyone tried this on an iPhone instead of an iPad? I do not have an iPhone, but I was reading Matt Neuburg's book today where he says UIImagePicker works differently on the 2 devices.</p> <p><strong>edit 0</strong></p> <p>I cannot see the image I am attempting to overlay across the camera view in UIImagePicker. No matter how I add the IBOutlet, as a property or not, the image does not show, but the overlayed toolbar shows fine. Why?</p> <p>OverlayViewController.h with <code>theKing</code> IBOutlet added to Apple's sample code and then commented out for now.</p> <pre><code>#import &lt;UIKit/UIKit.h&gt; #import &lt;AudioToolbox/AudioServices.h&gt; @protocol OverlayViewControllerDelegate; @interface OverlayViewController : UIViewController &lt;UINavigationControllerDelegate, UIImagePickerControllerDelegate&gt; { // IBOutlet UIImageView* theKing; ******** temporarily commented out id &lt;OverlayViewControllerDelegate&gt; delegate; } @property (nonatomic, assign) id &lt;OverlayViewControllerDelegate&gt; delegate; @property (nonatomic, retain) UIImagePickerController *imagePickerController; - (void)setupImagePicker:(UIImagePickerControllerSourceType)sourceType; @end @protocol OverlayViewControllerDelegate - (void)didTakePicture:(UIImage *)picture; - (void)didFinishWithCamera; @end </code></pre> <p>OverlayViewController.m with the <code>property</code> for <code>theKing</code> IBOutlet added to Apple's sample code.</p> <pre><code>#import "OverlayViewController.h" enum { kOneShot, // user wants to take a delayed single shot kRepeatingShot // user wants to take repeating shots }; @interface OverlayViewController ( ) @property (assign) SystemSoundID tickSound; @property (nonatomic, retain) IBOutlet UIImageView* theKing; // added ********* @property (nonatomic, retain) IBOutlet UIBarButtonItem *takePictureButton; @property (nonatomic, retain) IBOutlet UIBarButtonItem *startStopButton; @property (nonatomic, retain) IBOutlet UIBarButtonItem *timedButton; @property (nonatomic, retain) IBOutlet UIBarButtonItem *cancelButton; @property (nonatomic, retain) NSTimer *tickTimer; @property (nonatomic, retain) NSTimer *cameraTimer; </code></pre> <p>I cannot see the image <code>theKing</code> when I execute the code on an iPhone. Below is a view of the nib I have added showing some of the connections made. No errors are thrown, but I cannot see the image, only the UIToolbar already added. </p> <p><img src="https://i.stack.imgur.com/a5Gvd.png" alt="nib of overlay controller"></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.
 

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