FoundationExtension
FoundationExtension is common Foundation/UIKit/Cocoa shortcuts and snippets collection.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
NSImage.h
Go to the documentation of this file.
1 //
2 // NSImage.h
3 // FoundationExtension
4 //
5 // Created by Jeong YunWon on 13. 4. 23..
6 // Copyright (c) 2013 youknowone.org. All rights reserved.
7 //
8 
15 #import <Cocoa/Cocoa.h>
16 
22 
28 + (id)imageWithContentsOfURL:(NSURL *)url;
34 + (id)imageByReferencingURL:(NSURL *)url;
40 + (id)imageWithPasteboard:(NSPasteboard *)pasteboard;
41 
45 @property(nonatomic, readonly) NSData *PNGRepresentation;
49 @property(nonatomic, readonly) NSData *JPEGRepresentation;
53 - (NSData *)JPEGRepresentationWithCompressionFactor:(CGFloat)compressionFactor;
54 
55 @end
56 
57 
63 
70 - (void)drawNinePartImageInRect:(NSRect)toRect capInsets:(NSEdgeInsets)capInsets;
77 - (NSImage*)ninePartImageWithSize:(NSSize)size capInsets:(NSEdgeInsets)capInsets;
78 
79 @end
80 
81 
82 @interface CAANinePartImageLayer : CALayer
83 
84 @property(nonatomic,strong) NSImage *image;
85 @property(nonatomic,assign) NSEdgeInsets capInsets;
86 
87 - (instancetype)initWithImage:(NSImage *)image capInsets:(NSEdgeInsets)capInsets;
88 + (instancetype)layerWithImage:(NSImage *)image capInsets:(NSEdgeInsets)capInsets;
89 
90 @end
NSData * JPEGRepresentation
JPEG representation of image.
Definition: NSImage.h:49
NSImage shortcuts.
Definition: NSImage.h:21
Definition: NSImage.h:82
NSData * PNGRepresentation
PNG representation of image.
Definition: NSImage.h:45
NSDrawNinePartImage convinient methods.
Definition: NSImage.h:62