Skip to content

YuanfuC/ResizeImage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Resize Image

Create the UIImage category, use the Core Graphics to resize the UIImage in Objective-C

How to use

origin:

image

Scale fill to 1000 X 1000

 UIImage *scaleFillImage =  
 [sourceImage resize:CGSizeMake(1000, 1000)];
 

image

Aspect fit to 1000 * 1000, and fill red color. Default fill color is black, default mode is AspectFit

UIImage *aspectFitImage =  
[sourceImage resize:CGSizeMake(1000, 1000) 
fillColor:UIColor.redColor 
mode:ImageResizeModeAspectFit];
 

image

Aspect fill to 1000 x 1000

   UIImage *aspectFillImage =
   [sourceImage
   resize:CGSizeMake(1000, 1000)
   fillColor:UIColor.clearColor
   mode:ImageResizeModeAspectFill];

image

About

iOS UIImage Resize category

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published