 |
 |
|
 |
06-30-2009, 05:23 AM
|
#1 (permalink)
|
|
Registered Member
Join Date: May 2009
Posts: 25
|
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.
|
|
|
06-30-2009, 11:14 AM
|
#2 (permalink)
|
|
Registered Member
Join Date: May 2009
Posts: 25
|
Can anyone help or guide me in the right direction?
Thanks.
|
|
|
06-30-2009, 01:11 PM
|
#3 (permalink)
|
|
Registered Member
Join Date: Jun 2009
Posts: 82
|
["nameoffview".view removeFromSuperview];
|
|
|
06-30-2009, 01:13 PM
|
#4 (permalink)
|
|
Registered Member
Join Date: May 2009
Posts: 25
|
Quote:
Originally Posted by SmoshySmosh
["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....
|
|
|
06-30-2009, 01:30 PM
|
#5 (permalink)
|
|
Registered Member
Join Date: Jun 2009
Posts: 82
|
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.
|
|
|
07-01-2009, 02:39 AM
|
#6 (permalink)
|
|
Registered Member
Join Date: May 2009
Posts: 25
|
Quote:
Originally Posted by SmoshySmosh
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.
|
|
|
07-01-2009, 11:31 AM
|
#7 (permalink)
|
|
Registered Member
Join Date: May 2009
Posts: 25
|
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?
|
|
|
07-01-2009, 02:41 PM
|
#8 (permalink)
|
|
Registered Member
Join Date: Jun 2009
Posts: 82
|
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];
}
|
|
|
07-01-2009, 03:14 PM
|
#9 (permalink)
|
|
Registered Member
Join Date: May 2009
Posts: 25
|
Tried that - my overlay doesn't even get shown because it gets removed before the camera is activated!
Any other ideas?
|
|
|
07-02-2009, 02:49 AM
|
#10 (permalink)
|
|
Registered Member
Join Date: May 2009
Posts: 25
|
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.
|
|
|
07-02-2009, 10:47 AM
|
#11 (permalink)
|
|
Registered Member
Join Date: Jun 2009
Posts: 82
|
Send me your code and I will tinker with it.
|
|
|
07-04-2009, 11:42 AM
|
#12 (permalink)
|
|
Registered Member
Join Date: May 2009
Posts: 25
|
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.
|
|
|
 |
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
» Advertisements |
» Online Users: 336 |
| 31 members and 305 guests |
| ataranlen, b3b0p, benoitr007, bensj, Bertrand21, brandons, BrianSlick, ChrisMayer, CunningCat, Falcon80, HemiMG, intomo, jamison, javaconvert, jbro, JoshuaCaputo, Kalimba, LemonMeringue, maiuridavide, Noise, obiwahn, RedM, ricobeck, robertyang999, scotopia, ShayansMind, smasher, SomeRandomNerd, ToM, wes42, ZunePod |
| Most users ever online was 779, 05-11-2009 at 09:55 AM. |
» Stats |
Members: 24,261
Threads: 39,058
Posts: 171,277
Top Poster: smasher (2,575)
|
| Welcome to our newest member, SomeRandomNerd |
|