Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/extensions/Variables/includes/ExtVariables.php on line 198

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/extensions/Variables/includes/ExtVariables.php on line 198

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/extensions/Variables/includes/ExtVariables.php on line 198

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/extensions/Variables/includes/ExtVariables.php on line 198
LayerSnapshotter: Difference between revisions - iPhone Development Wiki

LayerSnapshotter: Difference between revisions

From iPhone Development Wiki
(Created page with "{{Infobox Package |developer=Ryan Petrich |version=1.0 |package=com.rpetrich.layersnapshotter }} Adds APIs to snapshot UIViews and CALayers. == LayerSnapshotter Header == <s...")
 
Line 29: Line 29:
UIView *newView = [[UIView alloc] initWithFrame:CGRectMake(0,0,320,480)];
UIView *newView = [[UIView alloc] initWithFrame:CGRectMake(0,0,320,480)];
UIImage *imageOfView = [newView renderSnapshot];
UIImage *imageOfView = [newView renderSnapshot];
@end
</source>
</source>
== References ==
== References ==



Revision as of 11:33, 30 August 2013

LayerSnapshotter
Cydia Package
Developer Ryan Petrich
Package ID com.rpetrich.layersnapshotter
Latest Version 1.0


Adds APIs to snapshot UIViews and CALayers.

LayerSnapshotter Header

#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>

@interface CALayer (Snapshot)
- (UIImage *)renderSnapshotWithScale:(CGFloat)scale;
@end

@interface UIView (Snapshot)
- (UIImage *)renderSnapshot;
@end

@interface UIImage (Saving)
- (BOOL)writeToFile:(NSString *)path atomically:(BOOL)atomically;
@end

Example Use

UIView *newView = [[UIView alloc] initWithFrame:CGRectMake(0,0,320,480)];
UIImage *imageOfView = [newView renderSnapshot];

References

ModMyI Package Info for LayerSnapShotter
rpetrich Slide from WWJC 2013