UIImage+AWKit.h

Includes:
<UIKit/UIKit.h>

Introduction

Use the links in the table of contents to the left to access the documentation.



Methods

+AWImageAspectFillSize:constrainedToSize:
+AWImageAspectFitSize:constrainedToSize:
+imageWithDataScreenScale:
+sizeFromHeight:
+sizeFromWidth:
+sizeToAspectFitSize:

AWImageAspectFillSize:constrainedToSize:


- (CGSize)AWImageAspectFillSize:(CGSize)imageSize 
        constrainedToSize:(CGSize)constrainSize;  
Parameters
imageSize

- The original image size

constrainingSize

- The wanted image size

Return Value

The size of the image constrined with aspect fill size

Discussion

Calculates the aspect fill size of an image given a constraining size


AWImageAspectFitSize:constrainedToSize:


- (CGSize)AWImageAspectFitSize:(CGSize)imageSize 
        constrainedToSize:(CGSize)constrainingSize;  
Parameters
imageSize

- The original image size

constrainingSize

- The wanted image size

Return Value

The size of the image constrined with aspect fit

Discussion

Calculates the aspect fit size of an image given a constraining size


imageWithDataScreenScale:


+ (UIImage*)imageWithDataScreenScale:(NSData*)data;  
Parameters
data

- The NSData to convert to a UIImage

Return Value

The UIImage or nil if data was nil.

Discussion

Creates an image with the scale factor of the main screen.


sizeFromHeight:


- (CGSize)sizeFromHeight:(CGFloat)height;  
Parameters
height

- The wanted image height

Return Value

The size of the image given a certain height

Discussion

Calculates the image size given just the height with proportional ratio


sizeFromWidth:


- (CGSize)sizeFromWidth:(CGFloat)width;  
Parameters
width

- The wanted image width

Return Value

The size of the image given a certain width

Discussion

Calculates the image size given just the width with proportional ratio


sizeToAspectFitSize:


- (CGSize)sizeToAspectFitSize:(CGSize)size;  
Parameters
size

- The wanted size of the image

Return Value

The size of the image constrined with aspect fit

Discussion

As AWImageAspectFitSize, but calculated on self (UIImage shorthand)

See

AWImageAspectFitSize