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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.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 07-21-2009, 05:25 AM   #1 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 19
Smile Camera Woes.

After days of vain searching - I resorted to posting a thread... The problem I have is this:
I would like to capture multiple images from iPhone's camera. I don't specifically mind using the UIImagePicker but i need to have similar functionality to "25 Shot - Cam Replay" and Cycorder - (without the compression or audio) In short I need to capture multiple images synthesizing touch events is fine with me, and using the private frameworks is an option, but preferably not. Can somebody give me some insight into this problem?

PS: 3.0 isn't really a problem this early into development - though some warnings wouldn't go amiss .

Thanks so much;
[Steake grateful];
Steake is offline   Reply With Quote
Old 07-21-2009, 10:41 AM   #2 (permalink)
Registered Member
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,556
Send a message via ICQ to smithdale87 Send a message via AIM to smithdale87 Send a message via Skype™ to smithdale87
Default

Just though of this..

Could you use UIImagePicker, then while it's open, take a screenshot of the screen programmatically many times? Sounds like it should give the effect you want, in theory. Then if you want, you can save each image to the photos album.
smithdale87 is offline   Reply With Quote
Old 07-21-2009, 10:48 AM   #3 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 19
Unhappy

This is what i've been battling with all day :'( It seems that the view is somehow protected or delegated. I *cannot* screenshot it programatically. No matter the method weather it's the fully documented and legal renderInContext:UIGraphicsGetCurrentContext() or the undocumented UIGetScreenImage(), the second I cannot make even compile. It's quite frustrating. Anybody got any ideas?
Steake is offline   Reply With Quote
Old 07-21-2009, 12:01 PM   #4 (permalink)
Registered Member
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,556
Send a message via ICQ to smithdale87 Send a message via AIM to smithdale87 Send a message via Skype™ to smithdale87
Default

bummer. If I were near my mac, I'd try out some stuff for you.
smithdale87 is offline   Reply With Quote
Old 07-22-2009, 04:24 AM   #5 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 19
Cool UIGetScreenImage();

So I got it working, think I'll attempt to make it work under 3.0 now. To be honest apple should provide ether the photo library API. Or a better interface. We all know why though. If they make it easy and legal to capture fast frames- then they wouldn't sell the 3GS as a movie device as well because people could make movie recorders. Ah well at some point I'll share the source for it (pm me if you need it *now* ). It uses uigetscreenimage() however so it's not totally legit. .
Steake is offline   Reply With Quote
Old 07-22-2009, 07:29 AM   #6 (permalink)
SBG
Registered Member
 
Join Date: Jul 2009
Posts: 19
Default

you should try out 3.1 beta sdk - there are some things provided you'd sure be happy about
SBG is offline   Reply With Quote
Old 07-22-2009, 10:06 AM   #7 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 19
Wink

ooooh! Please tell me... The download has started!
Steake is offline   Reply With Quote
Old 07-22-2009, 10:18 AM   #8 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 19
Default

Added UIImagePickerController.cameraOverlayView
Added UIImagePickerController.cameraViewTransform
Added UIImagePickerController.showsCameraControls
Added -[UIImagePickerController takePicture]

WOW! Awesome last call.
Steake is offline   Reply With Quote
Old 07-22-2009, 10:23 AM   #9 (permalink)
Registered Member
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,556
Send a message via ICQ to smithdale87 Send a message via AIM to smithdale87 Send a message via Skype™ to smithdale87
Default

nice!
smithdale87 is offline   Reply With Quote
Old 09-09-2009, 11:28 PM   #10 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 1
Default

Quote:
Originally Posted by Steake View Post
Added UIImagePickerController.cameraOverlayView
Added UIImagePickerController.cameraViewTransform
Added UIImagePickerController.showsCameraControls
Added -[UIImagePickerController takePicture]

WOW! Awesome last call.
I still dont see a way to get the screen image ie. no public replacement for UIGetScreenImage

With camera view UIGraphicsBeginImageContext(self.view.frame.size); returns a black image

Any ideas?
spiffy26 is offline   Reply With Quote
Old 12-01-2009, 08:30 AM   #11 (permalink)
Registered Member
 
Join Date: Oct 2008
Location: London, UK
Posts: 249
Default

Quote:
Originally Posted by spiffy26 View Post
I still dont see a way to get the screen image ie. no public replacement for UIGetScreenImage

With camera view UIGraphicsBeginImageContext(self.view.frame.size); returns a black image

Any ideas?
Has anyone figured this one out yet? Black for me too.
__________________
Beard Booth HD - See what you'd look like with a beard today!

My iPhone Apps
My iPhone Tutorials
mattjgalloway is offline   Reply With Quote
Old 01-15-2010, 02:16 AM   #12 (permalink)
Registered Member
 
duckeatapple's Avatar
 
Join Date: Jan 2010
Posts: 7
Default

Just a quick update that now you are officially allowed to use the private API UIGetScreenImage() to capture screen. Apple said yes to apps using UIGetScreenImage() last month (Dec. 2009).

A future release of iPhone OS may provide a public API equivalent of this functionality. As such time all applications using UIGetScreenImage() will be required to adopt the public API.

Here's how I did it.
To use UIGetScreenImage(), you need to include this line

Code:
CGImageRef UIGetScreenImage();
in your header, before the @class ... line.

And below is the function I used to get the screen captured programmatically.


Code:
+ (void) captureScreenToMemory {
	
	CGImageRef screen = UIGetScreenImage();
	if (screen) {
		UIImage *image = [[UIImage alloc] initWithCGImage:screen];
		CFRelease(screen);	
		UIImageWriteToSavedPhotosAlbum(image, nil,nil,nil);
	}

}
__________________

Find everything about video camera phones on my blog - http://duckeatapple.com
Follow me on Twitter - @DuckEatApple
Contact Me
duckeatapple is offline   Reply With Quote
Old 06-16-2010, 12:43 PM   #13 (permalink)
Registered Member
 
Keys's Avatar
 
Join Date: Jun 2010
Location: Edinburgh, UK
Posts: 57
Default

Hi,

Im new to the forum, have been developing for a few months now but having trouble with the camera utility so wondering whether anyone will be able to help.

So far im managed to get the camera on, with an overlay of a slider bar over it and other non related things. However, im not able to get the slider bar linked to update the cameras cameraViewTransform value when the sliders value changes.

Any ideas?
Keys is offline   Reply With Quote
Reply

Bookmarks

Tags
3.0, camera, iphone, uiimagepicker

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: 278
19 members and 259 guests
2WeeksToGo, ADY, apatsufas, dacapo, Dani77, Fritzer, ghost, HDshot, headkaze, masc2279, mer10, mystic.purple, objch, Rudy, stoneage, tathaastu, themathminister, timle8n1, Zool
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,878
Threads: 89,224
Posts: 380,732
Top Poster: BrianSlick (7,129)
Welcome to our newest member, olga2000
Powered by vBadvanced CMPS v3.1.0

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