hi people, how can i take screenshots of the current view in my app. and link it to an action/UIButton. i know i could get the user to just use home and top button but they'll be doing that loads of times. all i really need to know is whats the function to handle this sort of thing. cheers in advance.
Is there a way to increase the pixel count of a screenshot? I would like to print a screenshot photo on to a piece of paper, but when i do, the image appears fuzzy, and i believe it is because the screenshot is being saved in the lowest possible pixel count.
you might also need to import coregraphics.framework which you can find by:
project/ add to project / system/library/frameworks
Hey, it works perfect, but my App is in Landscape and it takes the screen shot in portrait mode, is there any more code i should put in to make it work with landscape?
Hey, it works perfect, but my App is in Landscape and it takes the screen shot in portrait mode, is there any more code i should put in to make it work with landscape?
I actually need this in my app now too. Did anyone figure this out?
Ok, despite the fact that most of the posts on the internet pertaining to this subject make it sound quite difficult to use this code in landscape mode, it is actually extremely easy. Just change the first line of this function:
Depending on what kind of view you need to use this in, just change the rect. I am using this in a UIViewController, but it would work just the same for a regular UIView (just omit the ".view"). Change the above line of code to:
You can also specifically set each parameter to your own dimensions:
Code:
CGRect screenRect = CGRectMake(0, 0, 480, 320);
However this is strongly advised against due to the fact that it offers absolutely no flexibility for any changes that might occur in new devices or updates. It can open up the door to potential problems down the road. Hope this helps anyone who might be needing it.