Skip to content

yvanwang1992/YFShrinkImage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YFShrinkImage

YFShrinkImage is a category of UIImage which shrink partial of image.

博客园记录: 【IOS】详解图片局部拉伸 + 实现图片局部收缩

How To Use It?

#import "UIImage+YFShrink.h"

UIImage *originImage = [UIImage imageNamed:@"wechat"]; //200 * 78

UIImage *shrinkImage = [originImage shrinkImageWithCapInsets:UIEdgeInsetsMake(30, 40, 30, 60) actualSize:CGSizeMake(150, 60)];

shrinkButton = [[UIButton alloc] initWithFrame:CGRectMake(20, 320, 150, 60)];

[shrinkButton setBackgroundImage:shrinkImage forState:UIControlStateNormal];

[self.view addSubview:shrinkButton];

Effection:  

 Shrink  Note

About

Shrink Image

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published