Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development > iPhone SDK Development - Advanced Discussion

Reply
 
LinkBack Thread Tools Display Modes
Old 07-28-2009, 11:32 AM   #1 (permalink)
Registered Member
 
Join Date: Oct 2008
Posts: 73
SAG3194 is on a distinguished road
Default Integrating Camera Overlay View

Anyone have code to implement the camera overlay?
Yes I am running 3.1

Thanks
SAG3194 is offline   Reply With Quote
Old 08-06-2009, 12:13 AM   #2 (permalink)
Registered Member
 
Join Date: Apr 2009
Posts: 4
karl is on a distinguished road
Default

Did you ever happen to get this working? I was just giving it a look but the way I expected it to accept a cameraOverlayView
[myPicker.cameraOverlayView addSubview:myOverlayView];
did not make the application happy. Curious if you found any documentation other than the few lines in the beta release docs. Interested to see this in action.
Thanks,
Karl
karl is offline   Reply With Quote
Old 08-10-2009, 11:00 AM   #3 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 11
pmark is on a distinguished road
Default

Quote:
Originally Posted by karl View Post
Did you ever happen to get this working? I was just giving it a look but the way I expected it to accept a cameraOverlayView
[myPicker.cameraOverlayView addSubview:myOverlayView];
did not make the application happy. Curious if you found any documentation other than the few lines in the beta release docs. Interested to see this in action.
Thanks,
Karl
Here is info and sample code to produce a full screen camera with a custom overlay using changes that came with the iPhone SDK 3.1 beta 2.

Bordertown Labs Blog

I'm using this technique in hiBubble to blow bubbles into my augmented reality.




pmark
pmark is offline   Reply With Quote
Old 08-10-2009, 11:44 AM   #4 (permalink)
Registered Member
 
Join Date: Apr 2009
Posts: 4
karl is on a distinguished road
Default

Quote:
Originally Posted by pmark View Post
Here is info and sample code to produce a full screen camera with a custom overlay using changes that came with the iPhone SDK 3.1 beta 2.

Bordertown Labs Blog

I'm using this technique in hiBubble to blow bubbles into my augmented reality.




pmark
Awesome, thanks for the link! Got mine working the other day but this looks far more powerful. Cool stuff.
Like your app btw.
Karl
karl is offline   Reply With Quote
Old 08-10-2009, 02:00 PM   #5 (permalink)
Registered Member
 
kilobytedump's Avatar
 
Join Date: Oct 2008
Posts: 195
kilobytedump is on a distinguished road
Default

Quote:
Originally Posted by karl View Post
Awesome, thanks for the link! Got mine working the other day but this looks far more powerful. Cool stuff.
Like your app btw.
Karl
Hi, maybe I'm just being reeaaallly stupid but I can't see any sample code on that page.
kilobytedump is offline   Reply With Quote
Old 08-10-2009, 03:29 PM   #6 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 11
pmark is on a distinguished road
Default

Quote:
Originally Posted by kilobytedump View Post
Hi, maybe I'm just being reeaaallly stupid but I can't see any sample code on that page.
I took down the code after someone reminded me that the NDA restricts us from distributing prerelease code. The new UIImagePickerController docs should help a lot.

My BTLFullScreenCameraController is pretty simple. It subclasses UIImagePickerController and hides the camera controls, navigation bar and toolbar. It also stretches the view to fit the full screen.

Use your subclass just like a normal UIImagePickerController. It's easier to present it as modal, but I had trouble making a modal view respond to motion and touch events. (I'd still like to know how that works!) Strangely, I was able to make my non-modal full screen camera work, which lets hiBubble toggle the augmented reality view on and off by rotating the phone. But then in my Helpful iPhone Utilities example app (which will be publicly available again after 3.1 is released) I had to go modal since the non-modal full screen camera wasn't cooperating.

Right when I thought I knew what I was doing...

Last edited by pmark; 08-18-2009 at 12:24 PM.
pmark is offline   Reply With Quote
Old 08-21-2009, 12:46 PM   #7 (permalink)
Registered Member
 
Join Date: Mar 2009
Posts: 59
crivoli is on a distinguished road
Default

Quote:
Originally Posted by karl View Post
Awesome, thanks for the link! Got mine working the other day but this looks far more powerful. Cool stuff.
Like your app btw.
Karl
I just installed Xcode 3.1.4 and the new 3.1 Video Capture and Camera Controls sections are not in the Documentation. Did I do something wrong?

I installed Xcode to a different directory so it wouldn't overwrite 3.1.3 ( Not sure if I had to do this but I did anyway.)

The Docs are the same as before but it shows that the documentation is from the Iphone OS 3.1 Library.

Any ideas?

Thanks
crivoli is offline   Reply With Quote
Old 08-21-2009, 02:45 PM   #8 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 11
pmark is on a distinguished road
Default

Quote:
Originally Posted by crivoli View Post
I just installed Xcode 3.1.4 and the new 3.1 Video Capture and Camera Controls sections are not in the Documentation. Did I do something wrong?...The Docs are the same
The current documentation does not appear to be updated. At least, the UIImagePickerController docs do not show what the online docs do.
pmark is offline   Reply With Quote
Old 08-21-2009, 05:31 PM   #9 (permalink)
Registered Member
 
Join Date: Mar 2009
Posts: 59
crivoli is on a distinguished road
Default

Quote:
Originally Posted by pmark View Post
The current documentation does not appear to be updated. At least, the UIImagePickerController docs do not show what the online docs do.
Thanks, I thought I was going crazy. Can anyone at least give me a command showing how to call the cameraOverlayView method. My syntax must be off and the docs don't show any syntax.

Thanks again
crivoli is offline   Reply With Quote
Old 08-21-2009, 06:49 PM   #10 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 11
pmark is on a distinguished road
Default

Quote:
Originally Posted by crivoli View Post
how to call the cameraOverlayView method.
I can tell you that you need to alloc+init a UIImagePickerController and set the overlayView property to a non-opaque view. Then display the camera by calling presentModalViewController on the parent controller (probably self).

[self presentModalViewController:cameraController animated:YES]

If you figure out how to display the camera as a non-modal view then please let me know.

Also, there's a private github repository with sample full screen camera code. Let me know your github username and I'll add you...
pmark is offline   Reply With Quote
Old 08-21-2009, 07:11 PM   #11 (permalink)
Registered Member
 
Join Date: Mar 2009
Posts: 59
crivoli is on a distinguished road
Default

Quote:
Originally Posted by pmark View Post
I can tell you that you need to alloc+init a UIImagePickerController and set the overlayView property to a non-opaque view. Then display the camera by calling presentModalViewController on the parent controller (probably self).

[self presentModalViewController:cameraController animated:YES]

If you figure out how to display the camera as a non-modal view then please let me know.

Also, there's a private github repository with sample full screen camera code. Let me know your github username and I'll add you...
I dont have a github username. Only used it to grab the appsales-mobile app which is amazing.

Can you send me the link to the github project. I am searching for it but don't see anything about the camera.
crivoli is offline   Reply With Quote
Old 08-21-2009, 07:19 PM   #12 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 11
pmark is on a distinguished road
Default

Quote:
Originally Posted by crivoli View Post
I dont have a github username. Only used it to grab the appsales-mobile app which is amazing.

Can you send me the link to the github project. I am searching for it but don't see anything about the camera.
The project is private until OS 3.1 is released because Apple's NDA. If you want access before then (rumors say mid-September) then just create a free account and send me your username. Mine is pmark.
pmark is offline   Reply With Quote
Old 08-21-2009, 07:21 PM   #13 (permalink)
Registered Member
 
Join Date: Mar 2009
Posts: 59
crivoli is on a distinguished road
Default

Quote:
Originally Posted by pmark View Post
The project is private until OS 3.1 is released because Apple's NDA. If you want access before then (rumors say mid-September) then just create a free account and send me your username. Mine is pmark.
github name 'crivoli'.

Thanks
crivoli is offline   Reply With Quote
Old 08-21-2009, 08:34 PM   #14 (permalink)
Registered Member
 
Join Date: Mar 2009
Posts: 59
crivoli is on a distinguished road
Default

Quote:
Originally Posted by pmark View Post
The project is private until OS 3.1 is released because Apple's NDA. If you want access before then (rumors say mid-September) then just create a free account and send me your username. Mine is pmark.
pmark:

Can you answer this.

Is the cameraOverlayView property only able to handle one UIView? My guess is yes. What if you want to overlay many different images, buttons etc on top of the Camera.... Do you have to create a separate UIView, add all the objects to that view and them make that separate view the cameraOverlayView?

When trying this on 3.0 and adding the separate view as a subview of the camera picker the buttons are not clickable etc. If you add them individually as subviews to the camera picker it all works out fine.

Can you think of anything I could be doing wrong? It seems odd that adding them to another view and then adding that view to the camera should act different, or am I in left field here?

Thanks
crivoli is offline   Reply With Quote
Old 08-30-2009, 02:20 PM   #15 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 1
giofer2002 is on a distinguished road
Default No add, assign.

Quote:
Originally Posted by karl View Post
Did you ever happen to get this working? I was just giving it a look but the way I expected it to accept a cameraOverlayView
[myPicker.cameraOverlayView addSubview:myOverlayView];
did not make the application happy. Curious if you found any documentation other than the few lines in the beta release docs. Interested to see this in action.
Thanks,
Karl
Think that you do not have any overlay view instanciated. So instead of adding try to assign a UIImage view first.

Hope this help you !!!
giofer2002 is offline   Reply With Quote
Old 09-07-2009, 06:49 AM   #16 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 1
asimu is on a distinguished road
Default

Quote:
Originally Posted by pmark View Post
The project is private until OS 3.1 is released because Apple's NDA. If you want access before then (rumors say mid-September) then just create a free account and send me your username. Mine is pmark.
Hi pmark. Can you add me as well.

github username: asimu

thanks.
asimu is offline   Reply With Quote
Old 09-07-2009, 09:15 AM   #17 (permalink)
poor little lamb
 
Join Date: Sep 2009
Posts: 9
tadelv is on a distinguished road
Default

Hello everyone!

here is a snippet of my code for the camera overlay view, if you want to look at it:

Code:
	cameraController.sourceType = UIImagePickerControllerSourceTypeCamera;
	cameraController.showsCameraControls = NO;
	overlayView = [[LMCameraOverlayView alloc] initWithFrame:cameraController.view.frame];
	overlayView.delegate = self;
	measureLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 200, 300, 40)];
	measureLabel.backgroundColor = [UIColor clearColor];
	measureLabel.textColor = [UIColor whiteColor];
	measureLabel.font = [UIFont boldSystemFontOfSize:20.0f];
	[overlayView addSubview:measureLabel];
	overlayView.userInteractionEnabled = YES;

	cameraController.cameraOverlayView = overlayView;
The LMCameraOverlayView is just my subclass of UIView, i hope this post is not against the NDA

if it is, mods can delete this post and i am sorry for any inconvenience
tadelv is offline   Reply With Quote
Old 09-11-2009, 09:37 PM   #18 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 1
cmetts is on a distinguished road
Default cameraoverlay

Quote:
Originally Posted by pmark View Post
The project is private until OS 3.1 is released because Apple's NDA. If you want access before then (rumors say mid-September) then just create a free account and send me your username. Mine is pmark.
pmark: can you give me access to the github project you mention here:\

"Also, there's a private github repository with sample full screen camera code. Let me know your github username and I'll add you..."

Thanks so much! my username is cmetts

Chris
cmetts is offline   Reply With Quote
Old 09-16-2009, 07:14 AM   #19 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 2
darkcrayon is on a distinguished road
Default

I'm trying to implement my own button on a cameraOverlayView and use the takePicture method to capture photos. Does anyone know how to go about implementing this? How could it be done from "within" the UIImagePickerController?
darkcrayon is offline   Reply With Quote
Old 09-16-2009, 02:35 PM   #20 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 11
pmark is on a distinguished road
Default

Quote:
Originally Posted by darkcrayon View Post
I'm trying to implement my own button on a cameraOverlayView and use the takePicture method to capture photos. Does anyone know how to go about implementing this? How could it be done from "within" the UIImagePickerController?
Done and done and then some. You can now use BTLFullScreenCameraController to capture the camera and overlay views. The image is then saved to the photo album and also to a file named image.png in the documents directory.

Wouldn't it be nice if one of you fine people wrote code to upload image.png to a Facebook group?

See pmark's Helpful-iPhone-Utilities at master - GitHub
pmark is offline   Reply With Quote
Old 09-16-2009, 04:26 PM   #21 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 2
darkcrayon is on a distinguished road
Default

Quote:
Originally Posted by pmark View Post
Done and done and then some. You can now use BTLFullScreenCameraController to capture the camera and overlay views. The image is then saved to the photo album and also to a file named image.png in the documents directory.

Wouldn't it be nice if one of you fine people wrote code to upload image.png to a Facebook group?

See pmark's Helpful-iPhone-Utilities at master - GitHub
Ahh, that's great! Thanks.
darkcrayon is offline   Reply With Quote
Old 09-24-2009, 08:01 PM   #22 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 19
smpdawg is on a distinguished road
Default

Quote:
Originally Posted by pmark View Post
Done and done and then some. You can now use BTLFullScreenCameraController to capture the camera and overlay views. The image is then saved to the photo album and also to a file named image.png in the documents directory.

Wouldn't it be nice if one of you fine people wrote code to upload image.png to a Facebook group?

See pmark's Helpful-iPhone-Utilities at master - GitHub
Thanks for giving me early access to the repo recently, it was very helpful.
smpdawg is offline   Reply With Quote
Old 09-24-2009, 08:31 PM   #23 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 11
pmark is on a distinguished road
Default

Quote:
Originally Posted by smpdawg View Post
Thanks for giving me early access to the repo recently, it was very helpful.
Sure thing. Stay tuned for some nice additions to the full screen camera controller. A thumbnail appears after taking a picture, and tapping the thumbnail brings up a preview of the photo. Tap the photo to send it via email.
pmark is offline   Reply With Quote
Old 09-24-2009, 11:14 PM   #24 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 3
atomsk47 is on a distinguished road
Default

I really don't mean to threadjack but I have been pulling my hair out...
I am trying to add a UIButton the the cameraoverlayview. The button appears fine but does not work.

Here is where I make the button and add it to the view:
Code:
	lbutton = [UIButton buttonWithType:UIButtonTypeCustom];
	UIImage *limage = [UIImage imageNamed:@"laser-button.png"];
	lbutton.tag = 1;
	lbutton.frame = CGRectMake(240, 405, limage.size.width, limage.size.height);
	[lbutton addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside];
	[lbutton setImage:limage forState:UIControlStateNormal];
	[overlayView addSubview:lbutton];
And here is where I create the cameraview stuff
Code:
	BTLFullScreenCameraController *tmpCamera = [[BTLFullScreenCameraController alloc] init];
		self.camera = tmpCamera;
		[tmpCamera release];
		[self.camera.view setBackgroundColor:[UIColor blueColor]];
		[self.camera setCameraOverlayView:self.overlayView];
		[self.view bringSubviewToFront:camera.cameraOverlayView];
		camera.delegate = self;
atomsk47 is offline   Reply With Quote
Old 09-25-2009, 10:36 AM   #25 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 3
atomsk47 is on a distinguished road
Default

Quote:
Originally Posted by atomsk47 View Post
I really don't mean to threadjack but I have been pulling my hair out...
I am trying to add a UIButton the the cameraoverlayview. The button appears fine but does not work.

Here is where I make the button and add it to the view:
Code:
	lbutton = [UIButton buttonWithType:UIButtonTypeCustom];
	UIImage *limage = [UIImage imageNamed:@"laser-button.png"];
	lbutton.tag = 1;
	lbutton.frame = CGRectMake(240, 405, limage.size.width, limage.size.height);
	[lbutton addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside];
	[lbutton setImage:limage forState:UIControlStateNormal];
	[overlayView addSubview:lbutton];
And here is where I create the cameraview stuff
Code:
	BTLFullScreenCameraController *tmpCamera = [[BTLFullScreenCameraController alloc] init];
		self.camera = tmpCamera;
		[tmpCamera release];
		[self.camera.view setBackgroundColor:[UIColor blueColor]];
		[self.camera setCameraOverlayView:self.overlayView];
		[self.view bringSubviewToFront:camera.cameraOverlayView];
		camera.delegate = self;
Solved it. I had to initialize overlayView with a frame size.
atomsk47 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 359
8 members and 351 guests
.Snipe, BSH, givensur, guusleijsten, HemiMG, NSString, Paul Slocum, SillyHoney
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,645
Threads: 94,111
Posts: 402,862
Top Poster: BrianSlick (7,990)
Welcome to our newest member, leighec68
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:26 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0