Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 06-30-2009, 05:23 AM   #1 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 25
Default Remove camera overlay image

I've seen the opposite issue crop up on this forum a few times, but not this particular one.

I have managed to add a sub view to the picker controller, which overlays a transparent image onto the camera view. By the way, this is done in landscape mode.

Once the picture is taken, the preview is presented in portrait view - a bug within the SDK, but have to live with it! - Since this is presented in portrait view, I need to get rid of my overlay image as it interferes with the preview.

The problem is, the delegate method didFinishPickingImage is only called after the "Use" button is pressed on the picker view. I haven't found any intermediate delegate methods in between taking the picture, and seeing the preview.

So any ideas on how I can remove the image overlay before it gets to the preview screen?

Thanks.
ir001 is offline   Reply With Quote
Old 06-30-2009, 11:14 AM   #2 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 25
Default

Can anyone help or guide me in the right direction?

Thanks.
ir001 is offline   Reply With Quote
Old 06-30-2009, 01:11 PM   #3 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 82
Default

["nameoffview".view removeFromSuperview];
SmoshySmosh is offline   Reply With Quote
Old 06-30-2009, 01:13 PM   #4 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 25
Default

Quote:
Originally Posted by SmoshySmosh View Post
["nameoffview".view removeFromSuperview];
I know how to remove the subview. The problem is I want to remove the overlay subview after the camera snaps and before the preview appears.

There is no delegate method to capture this intermediate stage....
ir001 is offline   Reply With Quote
Old 06-30-2009, 01:30 PM   #5 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 82
Default

If you did it correctly by adding in the code to remove it right after the picture is taken, they would be gone like you are trying to do.
SmoshySmosh is offline   Reply With Quote
Old 07-01-2009, 02:39 AM   #6 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 25
Default

Quote:
Originally Posted by SmoshySmosh View Post
If you did it correctly by adding in the code to remove it right after the picture is taken, they would be gone like you are trying to do.
Would you be kind enough to show me an example code of how I can do this please?

Thanks.
ir001 is offline   Reply With Quote
Old 07-01-2009, 11:31 AM   #7 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 25
Default

Hi,

Does anyone have any ideas on this? This is what I'm doing.

When the button to take a picture is pressed, I'm doing:

Code:
overlayView.tag = 10;
[picker.view addSubview:overlayView];
[picker.view bringSubviewToFront:overlayView];
Then in the didFinishPickingImage delegate method, I'm removing it like this:

Code:
[[picker.view viewWithTag:10] removeFromSuperview];
The problem is - didFinishPickingImage delegate method only gets called after the preview image has been confirmed. So my overlay image keeps on displaying on the preview as well - which I'd like to remove.

Any ideas?
ir001 is offline   Reply With Quote
Old 07-01-2009, 02:41 PM   #8 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 82
Default

Try putting your remove code in right after all of your camera code but before your closing }. Get what I mean?

Code:
- (IBAction)takePicture {
blah blah blah blah blah blah
blah blah blah blah blah blah
blah blah blah blah blah blah
[[picker.view viewWithTag:10] removeFromSuperview];
}
SmoshySmosh is offline   Reply With Quote
Old 07-01-2009, 03:14 PM   #9 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 25
Default

Tried that - my overlay doesn't even get shown because it gets removed before the camera is activated!

Any other ideas?
ir001 is offline   Reply With Quote
Old 07-02-2009, 02:49 AM   #10 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 25
Default

Sorry to keep bumping this up, but I'm getting a little desperate, and haven't yet found a solution.

I was thinking that may be NSNotification can be used here to tell the app delegate that the camera has finished taking a picture, and before the preview version comes up?

Is that possible? Or any other solutions?

Thanks.
ir001 is offline   Reply With Quote
Old 07-02-2009, 10:47 AM   #11 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 82
Default

Send me your code and I will tinker with it.
SmoshySmosh is offline   Reply With Quote
Old 07-04-2009, 11:42 AM   #12 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 25
Default

Have managed to sort it out, although I'm not sure whether Apple will approve of it or not.

I've hooked an IBAction to the CameraPressButton. When you press the button to capture the image, the IBAction fires and removes the overlay from the view.

This ofcourse tinkers with the subview hierarchy of the camera view, but there is no other way to hook into the preview mode of the camera just after the capture.
ir001 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


Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,261
Threads: 39,058
Posts: 171,277
Top Poster: smasher (2,575)
Welcome to our newest member, SomeRandomNerd
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:38 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0