12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- //
- // UIImage+Resize.h
- // NYXImagesKit
- //
- // Created by @Nyx0uf on 02/05/11.
- // Copyright 2012 Nyx0uf. All rights reserved.
- // www.cocoaintheshell.com
- //
- #import "NYXImagesHelper.h"
- typedef enum
- {
- NYXCropModeTopLeft,
- NYXCropModeTopCenter,
- NYXCropModeTopRight,
- NYXCropModeBottomLeft,
- NYXCropModeBottomCenter,
- NYXCropModeBottomRight,
- NYXCropModeLeftCenter,
- NYXCropModeRightCenter,
- NYXCropModeCenter
- } NYXCropMode;
- @interface UIImage (NYX_Resizing)
- -(UIImage*)cropToSize:(CGSize)newSize usingMode:(NYXCropMode)cropMode;
- // NYXCropModeTopLeft crop mode used
- -(UIImage*)cropToSize:(CGSize)newSize;
- -(UIImage*)scaleByFactor:(float)scaleFactor;
- // Same as 'scale to fill' in IB.
- -(UIImage*)scaleToFillSize:(CGSize)newSize;
- // Preserves aspect ratio. Same as 'aspect fit' in IB.
- -(UIImage*)scaleToFitSize:(CGSize)newSize;
- // Preserves aspect ratio. Same as 'aspect fill' in IB.
- -(UIImage*)scaleToCoverSize:(CGSize)newSize;
- @end
|