一、图片裁剪
//拖动手势
- (void)handlePanGes:(PanGesRec *)panGes { CGPoint translation = [panGes translationInView:self.imgView.superview]; CGPoint movePoint = panGes.movedPoint; //判断开始滑动时的滑动对象:top、bottom、left、right if (panGes.state == GR_BEGIN) { //再次开始移动,shaView整体高亮 [UIView animateWithDuration:0.5 animations:^{ self.shaView.isSetShadow = NO; }]; if ([self judgeGesRecInViewWithMinX:self.clipAreaLayer.leftEdge+SHORT_LINE_LENGTH MaxX:self.clipAreaLayer.rightEdge-SHORT_LINE_LENGTH MinY:self.clipAreaLayer.topEdge-PANGR_OFFET MaxY:self.clipAreaLayer.topEdge+PANGR_OFFET]) { self.acGeView = CLIP_AREA_TOP; } else if ([self judgeGesRecInViewWithMinX:self.clipAreaLayer.leftEdge+SHORT_LINE_LENGTH MaxX:self.clipAreaLayer.rightEdge-SHORT_LINE_LENGTH MinY:self.clipAreaLayer.bottomEdge-PANGR_OFFET MaxY:self.clipAreaLayer.bottomEdge+PANGR_OFFET]) { self.acGeView = CLIP_AREA_BOTTOM; } else if ([self judgeGesRecInViewWithMinX:self.clipAreaLayer.leftEdge-PANGR_OFFET MaxX:self.clipAreaLayer.leftEdge+PANGR_OFFET MinY:self.clipAreaLayer.topEdge+SHORT_LINE_LENGTH MaxY:self.clipAreaLayer.bottomEdge-SHORT_LINE_LENGTH]) { self.acGeView = CLIP_AREA_LEFT; } else if ([self judgeGesRecInViewWithMinX:self.clipAreaLayer.rightEdge-PANGR_OFFET MaxX:self.clipAreaLayer.rightEdge+PANGR_OFFET MinY:self.clipAreaLayer.topEdge+SHORT_LINE_LENGTH MaxY:self.clipAreaLayer.bottomEdge-SHORT_LINE_LENGTH]) { self.acGeView = CLIP_AREA_RIGHT; } else if ([self judgeGesRecInViewWithMinX:self.clipAreaLayer.leftEdge-PANGR_OFFET MaxX:self.clipAreaLayer.leftEdge+PANGR_OFFET MinY:self.clipAreaLayer.topEdge MaxY:self.clipAreaLayer.topEdge+SHORT_LINE_LENGTH] || [self judgeGesRecInViewWithMinX:self.clipAreaLayer.leftEdge MaxX:self.clipAreaLayer.leftEdge+SHORT_LINE_LENGTH MinY:self.clipAreaLayer.topEdge-PANGR_OFFET MaxY:self.clipAreaLayer.topEdge+PANGR_OFFET]){ self.acGeView = CLIP_AREA_LT; } else if ([self judgeGesRecInViewWithMinX:self.clipAreaLayer.leftEdge-PANGR_OFFET MaxX:self.clipAreaLayer.leftEdge+PANGR_OFFET MinY:self.clipAreaLayer.bottomEdge-SHORT_LINE_LENGTH MaxY:self.clipAreaLayer.bottomEdge] || [self judgeGesRecInViewWithMinX:self.clipAreaLayer.leftEdge MaxX:self.clipAreaLayer.leftEdge+SHORT_LINE_LENGTH MinY:self.clipAreaLayer.bottomEdge-PANGR_OFFET MaxY:self.clipAreaLayer.bottomEdge+PANGR_OFFET]){ self.acGeView = CLIP_AREA_LB; } else if ([self judgeGesRecInViewWithMinX:self.clipAreaLayer.rightEdge-PANGR_OFFET MaxX:self.clipAreaLayer.rightEdge+PANGR_OFFET MinY:self.clipAreaLayer.topEdge MaxY:self.clipAreaLayer.topEdge+SHORT_LINE_LENGTH] || [self judgeGesRecInViewWithMinX:self.clipAreaLayer.rightEdge-SHORT_LINE_LENGTH MaxX:self.clipAreaLayer.rightEdge MinY:self.clipAreaLayer.topEdge-PANGR_OFFET MaxY:self.clipAreaLayer.topEdge+PANGR_OFFET]){ self.acGeView = CLIP_AREA_RT; } else if ([self judgeGesRecInViewWithMinX:self.clipAreaLayer.rightEdge-PANGR_OFFET MaxX:self.clipAreaLayer.rightEdge+PANGR_OFFET MinY:self.clipAreaLayer.bottomEdge-SHORT_LINE_LENGTH MaxY:self.clipAreaLayer.bottomEdge] || [self judgeGesRecInViewWithMinX:self.clipAreaLayer.rightEdge-SHORT_LINE_LENGTH MaxX:self.clipAre