12-15-2009, 05:37 PM
#26 (permalink )
Registered Member
Join Date: Oct 2008
Posts: 2,028
Very cool; I'm just looking through the stuff now to see if I can use this to take a screenshot of only a subsection of the screen.
12-15-2009, 05:51 PM
#27 (permalink )
Tutorial Author
Join Date: Oct 2008
Location: Ontario, Canada
Posts: 466
Quote:
Originally Posted by
NewiPhoneDeveloper
Seems like UIGetScreenImage() is now an official API call???
Please read this blog entry on TUAW
One guy in comments below says, that some Apple guy said on the official forums, that it is now allowed to make use of this API. Can't confirm this information, but it looks very interesting so far!
[EDIT: YES ITS TRUE!!! Log onto the official forums and do a search for UIGetScreenImage();
Here is the quote:
Do you have a link to that post?
12-15-2009, 05:54 PM
#28 (permalink )
Registered Member
Join Date: Jul 2008
Posts: 459
Quote:
Originally Posted by
Steaps
Do you have a link to that post?
Here you go:
Official thread
12-15-2009, 05:59 PM
#29 (permalink )
Tutorial Author
Join Date: Oct 2008
Location: Ontario, Canada
Posts: 466
Quote:
Originally Posted by
NewiPhoneDeveloper
Thanks (Just found it and was going to post :P)
12-15-2009, 06:14 PM
#30 (permalink )
Registered Member
Join Date: Oct 2008
Posts: 2,028
Are there standard docs on this method; or do we have to go digging in a special place. I as hoping you can restrict this to a subset of the screen (not on my mac and at my day job so cant really investigate).
12-15-2009, 08:45 PM
#31 (permalink )
Beast Iphone Developor
Join Date: Aug 2009
Location: Atlanta, Georgia
Age: 16
Posts: 1,302
well, apple now uses static analsys or something like that to detect any undocumented or private api.
So that probably why your cousin or whatever got his app approved a while ago, but now cant submit an update.
Apple has stepped up their game...which is bad for us.
Last edited by justill45; 12-15-2009 at 08:48 PM .
12-15-2009, 08:46 PM
#32 (permalink )
Registered Member
Join Date: Jul 2008
Posts: 459
Quote:
Originally Posted by
justill45
well, apple now uses static analsys or something like that to detect any undocumented or private api.
So that probably why your cousin or whatever got his app approved a while ago, but now cant submit an update.
Apple has stepped up their game...which is bad for us.
You're right, but they now definitely allow UIGetScreenImage();
12-15-2009, 08:48 PM
#33 (permalink )
Beast Iphone Developor
Join Date: Aug 2009
Location: Atlanta, Georgia
Age: 16
Posts: 1,302
Quote:
Originally Posted by
NewiPhoneDeveloper
You're right, but they now definitely allow UIGetScreenImage();
yeah, i didnt see the second page of this thread, but yeah, pretty cool. Is there any place i can see how to use this method?
12-15-2009, 08:55 PM
#34 (permalink )
Registered Member
Join Date: Jul 2008
Posts: 459
Quote:
Originally Posted by
justill45
yeah, i didnt see the second page of this thread, but yeah, pretty cool. Is there any place i can see how to use this method?
I think the following should work (untested):
In your AppDelegate.m or any other .m where you want to use this feature, add the following lines of code right below the #import section:
Code:
CGImageRef UIGetScreenImage();
@interface UIImage (ScreenImage)
+ (UIImage *)imageWithScreenContents;
@end
@implementation UIImage (ScreenImage)
+ (UIImage *)imageWithScreenContents
{
CGImageRef cgScreen = UIGetScreenImage();
if (cgScreen) {
UIImage *result = [UIImage imageWithCGImage:cgScreen];
CGImageRelease(cgScreen);
return result;
}
return nil;
}
@end
Now you can grab the screen like that:
Code:
- (void)grabScreen {
CGImageRef screen = UIGetScreenImage();
UIImage *screenImage = [UIImage imageWithCGImage:screen];
//now save your image or do with it whatever you like
}
12-16-2009, 09:00 AM
#35 (permalink )
Registered Member
Join Date: Jul 2009
Posts: 140
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: 263
20 members and 243 guests
ADY , AragornSG , Bertrand21 , Dani77 , Dattee , Duncan C , fkmtc , HDshot , HemiMG , iDifferent , JasonR , macquitzon216 , mer10 , prchn4christ , Promo Dispenser , Rudy , sacha1996 , sneaky , spiderguy84 , theone8one
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,231
Posts: 380,768
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp