图片剪裁

做项目是经常会遇见需要对图片进行剪裁的情况,下面来点干货

#import <UIKit/UIKit.h>

@protocol PassImageDelegate <NSObject>

-(void)passImage:(UIImage *)image;

@end

@interface CutImgageVC : UIViewController
@property(nonatomic,strong) id<PassImageDelegate> delegate;
@property(nonatomic,strong) UIImage *image;
@property(nonatomic,assign) float ratioWidth;//宽
@property(nonatomic,assign) float ratioHeight;//高
@property(nonatomic,assign) float minWidth;//最小宽
@end


#import "CutImgageVC.h"

#define imgViewWigth 30
@interface CutImgageVC ()<UIGestureRecognizerDelegate>{
    float imageX;
    float imageY;
    float imageW;
    float imageH;

}
@property(nonatomic,strong) UIImageView *bgImgView;
@property(nonatomic,strong) UIView *cutView;
@property(nonatomic,strong) UIImageView *topLeftImgView;
@property(nonatomic,strong) UIImageView *topRigthImgView;
@property(nonatomic,strong) UIImageView *bottomLeftImgView;
@property(nonatomic,strong) UIImageView *bottomRigthImgView;
@end

@implementation CutImgageVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //添加导航栏和完成按钮
    
    UINavigationBar *naviBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0,ScreenWidth, 64)];
    [self.view addSubview:naviBar];
    
    UINavigationItem *naviItem = [[UINavigationItem alloc] initWithTitle:@"图片裁剪"];
    [naviBar pushNavigationItem:naviItem animated:YES];
    
    //保存按钮
    UIBarButtonItem *doneItem = [[UIBarButtonItem alloc] initWithTitle:@"完成" style:UIBarButtonItemStylePlain target:self action:@selector(saveButton)];
    naviItem.rightBarButtonItem = doneItem;
    [self createImageView];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(void)saveButton{

    [self clipWithRect];
    [self dismissModalViewControllerAnimated:YES];
}

-(void)clipWithRect{
    CGRect cropFrame = self.cutView.frame;
    CGFloat orgX = (cropFrame.origin.x-imageX) * (self.image.size.width / imageW);
    CGFloat orgY = (cropFrame.origin.y-imageY) * (self.image.size.height /imageH);
    CGFloat width = cropFrame.size.width * (self.image.size.width / imageW);
    CGFloat height = width*_ratioHeight/_ratioWidth;
    CGRect cropRect = CGRectMake(orgX, orgY, width, height);
    CGImageRef imgRef = CGImageCreateWithImageInRect(self.bgImgView.image.CGImage, cropRect);
    
    CGFloat deviceScale = [UIScreen mainScreen].scale;
    UIGraphicsBeginImageContextWithOptions(cropRect.size, 0, deviceScale);
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextTranslateCTM(context, 0, cropRect.size.height);
    CGContextScaleCTM(context, 1, -1);
    CGContextDrawImage(context, CGRectMake(0, 0, cropRect.size.width, cropRect.size.height), imgRef);
    UIImage *newImg = UIGraphicsGetImageFromCurrentImageContext();
    CGImageRelease(imgRef);
    UIGraphicsEndImageContext();
    [self.delegate passImage:newImg];
}

-(void)createImageView{
    [self.view addSubview:self.bgImgView];
    [self.view addSubview:self.cutView];
    [self.view addSubview:self.topLeftImgView];
    [self.view addSubview:self.topRigthImgView];
    [self.view addSubview:self.bottomLeftImgView];
    [self.view addSubview:self.bottomRigthImgView];
    
    //设置默认值
    [self setDefaultInfo];
    
    self.cutView.origin=self.topLeftImgView.center;
}

-(void)setDefaultInfo{
    if (self.cutView.width<_minWidth) {
        self.cutView.width=_minWidth;
        self.cutView.height=self.cutView.width *_ratioHeight/_ratioWidth;
    }
    if (self.cutView.height<_minWidth *_ratioHeight/_ratioWidth) {
        self.cutView.height=_minWidth*_ratioHeight/_ratioWidth;
        self.cutView.width=_minWidth;
    }
    
    if (self.cutView.x<imageX) {
        self.cutView.x=imageX;
    }
    if (self.cutView.y<imageY){
        self.cutView.y=imageY;
    }
    if (self.cutView.x+self.cutView.width>imageW+imageX) {
        self.cutView.x=imageW+imageX-self.cutView.width;
        if (self.cutView.x<imageX) {
            self.cutView.x=imageX;
        }
        if (self.cutView.width>imageW) {
            self.cutView.width=imageW;
            self.cutView.height=self.cutView.width *_ratioHeight/_ratioWidth;
            
        }

       
    }
    if (self.cutView.y+self.cutView.height>imageH+imageY) {
        self.cutView.y=imageH+imageY-self.cutView.height;
        if (self.cutView.y<imageY){
            self.cutView.y=imageY;
        }
        if (self.cutView.height>imageH) {
            self.cutView.height=imageH;
            self.cutView.width=self.cutView.height *_ratioWidth/_ratioHeight;
        }
      
    }
    
    //更新4个imgView 的位置
    self.topLeftImgView.origin=CGPointMake(self.cutView.origin.x-imgViewWigth/2, self.cutView.origin.y-imgViewWigth/2);
    self.topRigthImgView.x=self.topLeftImgView.x+self.cutView.width;
    self.topRigthImgView.y=self.topLeftImgView.y;
    
    self.bottomLeftImgView.x=self.topLeftImgView.x;
    self.bottomLeftImgView.y=self.topLeftImgView.y+self.cutView.height;
    
    self.bottomRigthImgView.x= self.topRigthImgView.x;
    self.bottomRigthImgView.y= self.bottomLeftImgView.y;
    
}

-(void)updateFrameWithImgView{

}

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
    // 拿到UITouch就能获取当前点
    UITouch *touch = [touches anyObject];
    if (touch.view ==self.cutView) {
        // 获取当前点
        CGPoint curP = [touch locationInView:self.cutView];
        // 获取上一个点
        CGPoint preP = [touch previousLocationInView:self.cutView];
        // 获取手指x轴偏移量
        CGFloat offsetX = curP.x - preP.x;
        // 获取手指y轴偏移量
        CGFloat offsetY = curP.y - preP.y;
        // 移动当前view
        self.cutView.transform = CGAffineTransformTranslate(self.cutView.transform, offsetX, offsetY);
        
        
     [self setDefaultInfo];
    }
}


- (void)handleTDTap:(UIPanGestureRecognizer *)theTDTap{
    if (theTDTap.state==UIGestureRecognizerStateChanged) {
        UIImageView *imgView=(UIImageView *)[theTDTap view];
        CGPoint point = [theTDTap locationInView:self.view];
        
        CGPoint translation = [theTDTap translationInView:theTDTap.view];
        CGFloat absX = fabs(translation.x);
        CGFloat absY = fabs(translation.y);
        // 设置滑动有效距离
        if (MAX(absX, absY) < 10)
            return;
        //根据拖动点的Origin和比例更新当前框的大小
        if (absX>absY) {
            //横滑
            NSLog(@"123");
            [self slideWithHorizontally:imgView andPoint:point];
        }else if (absX<absY){
            //竖滑
            NSLog(@"1234");
            [self slideWithVerticaly:imgView andPoint:point];
        }else{
            NSLog(@"12345");
        }
        [self setDefaultInfo];
    }
}

//横滑判断
-(void)slideWithHorizontally:(UIImageView *)imgView andPoint:(CGPoint)point{

    if (imgView ==self.topLeftImgView) {
        //如果为第一个点
        imgView.origin=point;//更新当前imgView 的位置
        //改变第二个点的Y
        self.topRigthImgView.y= imgView.y;
        
        //更新self.cutView frame
        self.cutView.origin=self.topLeftImgView.center;
        self.cutView.width=self.topRigthImgView.x-self.topLeftImgView.x;
       
        self.cutView.height=self.cutView.width *_ratioHeight/_ratioWidth;
        
        //改变第三个点的X
        self.bottomLeftImgView.x=imgView.x;
        self.bottomLeftImgView.y= imgView.y+self.cutView.height;
        
        //第4个点的位置
        //            self.bottomRigthImgView.x= self.topRigthImgView.x;
        self.bottomRigthImgView.y= self.bottomLeftImgView.y;
    }else if (imgView ==self.topRigthImgView){
        //如果为第二个点
         imgView.origin=point;//更新当前imgView 的位置
        //改变第一个点的Y
        self.topLeftImgView.y=imgView.y;
        //更新self.cutView frame
        self.cutView.origin=self.topLeftImgView.center;
        self.cutView.width=self.topRigthImgView.x-self.topLeftImgView.x;
        self.cutView.height=self.cutView.width *_ratioHeight/_ratioWidth;
        
        //第3个点的位置
        //            self.bottomLeftImgView.x=self.topLeftImgView.x;
        self.bottomLeftImgView.y= imgView.y+self.cutView.height;
        
        //第4个点的位置
        self.bottomRigthImgView.x=imgView.x;
        self.bottomRigthImgView.y= self.bottomLeftImgView.y;
    }else if (imgView ==self.bottomLeftImgView){
        //如果为第3个点
        imgView.origin=point;//更新当前imgView 的位置

        //更新self.cutView frame
        
        //第4个点的位置
        self.bottomRigthImgView.y= imgView.y;
        
        self.cutView.width=self.bottomRigthImgView.x-self.bottomLeftImgView.x;
        self.cutView.height=self.cutView.width *_ratioHeight/_ratioWidth;
        
        //第1个点的位置
        self.topLeftImgView.x=imgView.x;
        self.topLeftImgView.y= imgView.y-self.cutView.height;;
        
        //第2个点的位置
        self.topRigthImgView.y= self.topLeftImgView.y;
        
        self.cutView.origin=self.topLeftImgView.center;
        
        
    }else if (imgView ==self.bottomRigthImgView){
        //如果为第4个点
        imgView.origin=point;//更新当前imgView 的位置
        //第3个点的位置
        self.bottomLeftImgView.y= imgView.y;
        //更新self.cutView frame
        
        self.cutView.width=self.bottomRigthImgView.x-self.bottomLeftImgView.x;
        self.cutView.height=self.cutView.width *_ratioHeight/_ratioWidth;
        
        //第1个点的位置
        self.topLeftImgView.y= imgView.y-self.cutView.height;
        
        //第2个点的位置
        self.topRigthImgView.x=imgView.x;
        self.topRigthImgView.y= self.topLeftImgView.y;
        
        self.cutView.origin=self.topLeftImgView.center;
    }else{
        return;
    }
//    [self setDefaultInfo];
    
}

-(void)slideWithVerticaly:(UIImageView *)imgView andPoint:(CGPoint)point{
   
    if (imgView ==self.topLeftImgView) {
        //如果为第一个点
        imgView.origin=point;//更新当前imgView 的位置
        //更新self.cutView frame
        self.cutView.origin=self.topLeftImgView.center;
        self.cutView.height=self.bottomLeftImgView.y-self.topLeftImgView.y;
        self.cutView.width=self.cutView.height *_ratioWidth/_ratioHeight;
        
        //改变第3个点
        self.bottomLeftImgView.x=imgView.x;
       
        //改变第二个点的Y
        self.topRigthImgView.x=imgView.x+self.cutView.width;
        self.topRigthImgView.y= imgView.y;
        
        //第4个点的位置
        self.bottomRigthImgView.x= self.topRigthImgView.x;
        self.bottomRigthImgView.y= self.bottomLeftImgView.y;
    }else if (imgView ==self.topRigthImgView){
        //如果为第二个点
         imgView.origin=point;//更新当前imgView 的位置
        //更新self.cutView frame
        self.cutView.height=self.bottomLeftImgView.y-self.topLeftImgView.y;
        self.cutView.width=self.cutView.height *_ratioWidth/_ratioHeight;
        
        //改变第4个点的X
        self.bottomRigthImgView.x=imgView.x;
        
        //改变第1个点的X
        self.topLeftImgView.x=imgView.x-self.cutView.width;
        self.topLeftImgView.y=imgView.y;
        self.cutView.origin=self.topLeftImgView.center;
        
        //第3个点的位置
        self.bottomLeftImgView.x=self.topLeftImgView.x;
        self.bottomLeftImgView.y= self.bottomRigthImgView.y;
        
    }else if (imgView ==self.bottomLeftImgView){
        //如果为第3个点

        imgView.origin=point;//更新当前imgView 的位置

        //更新self.cutView frame
        self.cutView.height=self.bottomLeftImgView.y-self.topLeftImgView.y;
        self.cutView.width=self.cutView.height *_ratioWidth/_ratioHeight;
        
        //第4个点的位置
        self.bottomRigthImgView.x= imgView.x+self.cutView.width;
        self.bottomRigthImgView.y=imgView.y;
        
        //第1个点的位置
        self.topLeftImgView.x=imgView.x;
        
        //第2个点的位置
        self.topRigthImgView.x=self.bottomRigthImgView.x;
        self.topRigthImgView.y= self.topLeftImgView.y;
        
        self.cutView.origin=self.topLeftImgView.center;
        
        
    }else if (imgView ==self.bottomRigthImgView){
        //如果为第4个点
        
        imgView.origin=point;//更新当前imgView 的位置

        //更新self.cutView frame
        self.cutView.height=imgView.y-self.topLeftImgView.y;
        self.cutView.width=self.cutView.height *_ratioWidth/_ratioHeight;

        
        //第3个点的位置
        self.bottomLeftImgView.x= imgView.x-self.cutView.width;
        self.bottomLeftImgView.y= imgView.y;
     
        //第1个点的位置
        self.topLeftImgView.x= self.bottomLeftImgView.x;
        
        //第2个点的位置
        self.topRigthImgView.x=imgView.x;
        self.topRigthImgView.y= self.topLeftImgView.y;
        
        self.cutView.origin=self.topLeftImgView.center;
    }else{
        return;
    }
    
    
}

-(UIImageView *)bgImgView{
    if (!_bgImgView) {
        _bgImgView=[[UIImageView alloc]initWithFrame:CGRectMake(0, 64, ScreenWidth, ScreenHeight-64)];
        _bgImgView.image=_image;
        _bgImgView.contentMode=UIViewContentModeScaleAspectFit;
        if (_bgImgView.image.size.width>=_bgImgView.image.size.height) {
            imageW=ScreenWidth;
            imageH=ScreenWidth *_bgImgView.image.size.height/_bgImgView.image.size.width;
        }else{
            imageH=ScreenHeight-64;
            imageW=imageH *_bgImgView.image.size.width/_bgImgView.image.size.height;
        }
        //计算图片X,Y
         imageX=(ScreenWidth-imageW)/2;
         imageY=(ScreenHeight-64-imageH)/2 +64;
    }
    return _bgImgView;
}

-(UIView *)cutView{
    if (!_cutView) {
        _cutView=[[UIView alloc]initWithFrame:CGRectMake((ScreenWidth-_minWidth)/2, 0, _minWidth, _minWidth*_ratioHeight/_ratioWidth)];
        _cutView.centerY= self.bgImgView.centerY;
        _cutView.backgroundColor=[UIColor clearColor];
        [Methods setBorder:_cutView andFloat:1.0 andColor:RGB(35, 198, 167)];
    }
    return _cutView;
}

-(UIImageView *)topLeftImgView{
    if (!_topLeftImgView) {
        _topLeftImgView=[[UIImageView alloc]initWithFrame:CGRectMake(55, 80, imgViewWigth, imgViewWigth)];
//        _topLeftImgView.backgroundColor=RGB(35, 198, 167);
       _topLeftImgView.image= [Methods ImageFromColor:RGB(35, 198, 167) andCGRect:CGRectMake(0, 0, 10, 10)];
        _topLeftImgView.userInteractionEnabled=YES;
        _topLeftImgView.contentMode=UIViewContentModeCenter;
        UIPanGestureRecognizer *tap=[[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handleTDTap:)];
        tap.delegate = self;
        tap.cancelsTouchesInView = NO;
        tap.delaysTouchesEnded = NO;
        [self.topLeftImgView addGestureRecognizer:tap];
       
    }
    return _topLeftImgView;
}
-(UIImageView *)topRigthImgView{
    if (!_topRigthImgView) {
        _topRigthImgView=[[UIImageView alloc]initWithFrame:CGRectMake(55, 100, imgViewWigth, imgViewWigth)];
//        _topRigthImgView.backgroundColor=RGB(35, 198, 167);
        _topRigthImgView.image= [Methods ImageFromColor:RGB(35, 198, 167) andCGRect:CGRectMake(0, 0, 10, 10)];
        _topRigthImgView.contentMode=UIViewContentModeCenter;
        _topRigthImgView.userInteractionEnabled=YES;
        UIPanGestureRecognizer *tap=[[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handleTDTap:)];
        tap.delegate = self;
        tap.cancelsTouchesInView = NO;
        tap.delaysTouchesEnded = NO;
        [self.topRigthImgView addGestureRecognizer:tap];
       
    }
    return _topRigthImgView;
}
-(UIImageView *)bottomLeftImgView{
    if (!_bottomLeftImgView) {
        _bottomLeftImgView=[[UIImageView alloc]initWithFrame:CGRectMake(55, 120, imgViewWigth, imgViewWigth)];
//        _bottomLeftImgView.backgroundColor=RGB(35, 198, 167);
        _bottomLeftImgView.image= [Methods ImageFromColor:RGB(35, 198, 167) andCGRect:CGRectMake(0, 0, 10, 10)];
        _bottomLeftImgView.contentMode=UIViewContentModeCenter;
        _bottomLeftImgView.userInteractionEnabled=YES;
        UIPanGestureRecognizer *tap=[[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handleTDTap:)];
        tap.delegate = self;
        tap.cancelsTouchesInView = NO;
        tap.delaysTouchesEnded = NO;
        [self.bottomLeftImgView addGestureRecognizer:tap];
     
    }
    return _bottomLeftImgView;
}

-(UIImageView *)bottomRigthImgView{
    if (!_bottomRigthImgView) {
        _bottomRigthImgView=[[UIImageView alloc]initWithFrame:CGRectMake(55, 140, imgViewWigth, imgViewWigth)];
//        _bottomRigthImgView.backgroundColor=RGB(35, 198, 167);
        _bottomRigthImgView.image= [Methods ImageFromColor:RGB(35, 198, 167) andCGRect:CGRectMake(0, 0, 10, 10)];
        _bottomRigthImgView.contentMode=UIViewContentModeCenter;
        _bottomRigthImgView.userInteractionEnabled=YES;
        UIPanGestureRecognizer *tap=[[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handleTDTap:)];
        tap.delegate = self;
        tap.cancelsTouchesInView = NO;
        tap.delaysTouchesEnded = NO;
        [self.bottomRigthImgView addGestureRecognizer:tap];
   
    }
    return _bottomRigthImgView;
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    
    // 禁用 iOS7 返回手势
    if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
        self.navigationController.interactivePopGestureRecognizer.enabled = NO;
    }
}
-(void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
//    self.navigationController.navigationBar.hidden=NO;
    
    
    // 开启
    if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
        self.navigationController.interactivePopGestureRecognizer.enabled = YES;
    }
}
@end

、、、

创建一个类,copy 你懂的,使用的时候需要添加PassImageDelegate这个代理方法,
然后在
、、、
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
//在这个代理方法里面我们做这样的处理
  CutImgageVC *vc = [[CutImgageVC alloc] init];
    vc.delegate = self;
    vc.image = _picImage;//你获取到的图片
    vc.ratioWidth = 1.0;
    vc.ratioHeight = 1.0;
    vc.minWidth = 80.0;
    vc.view.backgroundColor = [UIColor whiteColor];
    picker.navigationBar.hidden = YES;
    [picker pushViewController:vc animated:YES];

}
//剪裁后回调的image
- (void)passImage:(UIImage *)image {
    _headImage.image = image;
    [self uploadimage];//这个是上传图片的方法,看你们怎么处理了
}

是不是很简单啊,end。。。。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 215,874评论 6 498
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 92,102评论 3 391
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 161,676评论 0 351
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 57,911评论 1 290
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 66,937评论 6 388
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 50,935评论 1 295
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,860评论 3 416
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,660评论 0 271
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,113评论 1 308
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,363评论 2 331
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,506评论 1 346
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,238评论 5 341
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,861评论 3 325
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,486评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,674评论 1 268
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,513评论 2 368
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,426评论 2 352

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 172,047评论 25 707
  • 图片处理中经常用的图片剪裁,就是通过剪裁框确定图片剪裁的区域,然后剪去该区域的图片,今天实现了一下,其实图片剪裁本...
    jiangamh阅读 739评论 0 5
  • 一、简介: 大家应该知道,我们在见面上显示的ImageView的大小和从网络取到的图片的大小是不一样的,最好的结果...
    唠嗑008阅读 5,225评论 0 6
  • 这篇文章主要为大家详细介绍了iOS实现裁剪框和图片剪裁功能,具有一定的参考价值,感兴趣的小伙伴们可以参考一下图片处...
    木马不在转阅读 11,505评论 9 10
  • 从事iOS开发已经一年半有余了,发现整天去学这学那还不如静下心来把会的学习牢靠。一些基础的东西不好好学习会成...
    paraneaeee阅读 719评论 0 1