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 12-15-2009, 05:37 PM   #26 (permalink)
Registered Member
 
scotopia's Avatar
 
Join Date: Oct 2008
Posts: 2,028
Default

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.
scotopia is offline   Reply With Quote
Old 12-15-2009, 05:51 PM   #27 (permalink)
Tutorial Author
 
Steaps's Avatar
 
Join Date: Oct 2008
Location: Ontario, Canada
Posts: 466
Default

Quote:
Originally Posted by NewiPhoneDeveloper View Post
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?
Steaps is offline   Reply With Quote
Old 12-15-2009, 05:54 PM   #28 (permalink)
Registered Member
 
Join Date: Jul 2008
Posts: 459
Default

Quote:
Originally Posted by Steaps View Post
Do you have a link to that post?
Here you go: Official thread
__________________
Websites:
Friendlydeveloper - Coding Blog
Codingsessions - Live iOS Training

iPhone Apps:
TextPal - Powerful group messaging,
icePhone

Find me on LinkedIn
NewiPhoneDeveloper is offline   Reply With Quote
Old 12-15-2009, 05:59 PM   #29 (permalink)
Tutorial Author
 
Steaps's Avatar
 
Join Date: Oct 2008
Location: Ontario, Canada
Posts: 466
Default

Quote:
Originally Posted by NewiPhoneDeveloper View Post
Here you go: Official thread
Thanks (Just found it and was going to post :P)
Steaps is offline   Reply With Quote
Old 12-15-2009, 06:14 PM   #30 (permalink)
Registered Member
 
scotopia's Avatar
 
Join Date: Oct 2008
Posts: 2,028
Default

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).
scotopia is offline   Reply With Quote
Old 12-15-2009, 08:45 PM   #31 (permalink)
Beast Iphone Developor
 
justill45's Avatar
 
Join Date: Aug 2009
Location: Atlanta, Georgia
Age: 16
Posts: 1,302
Default

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.
justill45 is offline   Reply With Quote
Old 12-15-2009, 08:46 PM   #32 (permalink)
Registered Member
 
Join Date: Jul 2008
Posts: 459
Default

Quote:
Originally Posted by justill45 View Post
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();
__________________
Websites:
Friendlydeveloper - Coding Blog
Codingsessions - Live iOS Training

iPhone Apps:
TextPal - Powerful group messaging,
icePhone

Find me on LinkedIn
NewiPhoneDeveloper is offline   Reply With Quote
Old 12-15-2009, 08:48 PM   #33 (permalink)
Beast Iphone Developor
 
justill45's Avatar
 
Join Date: Aug 2009
Location: Atlanta, Georgia
Age: 16
Posts: 1,302
Default

Quote:
Originally Posted by NewiPhoneDeveloper View Post
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?
justill45 is offline   Reply With Quote
Old 12-15-2009, 08:55 PM   #34 (permalink)
Registered Member
 
Join Date: Jul 2008
Posts: 459
Default

Quote:
Originally Posted by justill45 View Post
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
}
__________________
Websites:
Friendlydeveloper - Coding Blog
Codingsessions - Live iOS Training

iPhone Apps:
TextPal - Powerful group messaging,
icePhone

Find me on LinkedIn
NewiPhoneDeveloper is offline   Reply With Quote
Old 12-16-2009, 09:00 AM   #35 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 140
Default

https://devforums.apple.com/message/149553#149553
HappyByte 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: 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
Powered by vBadvanced CMPS v3.1.0

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