Tôi cố gắng để xóa hình ảnh sử dụng đoạn mã saudrawInRect: mất chất lượng độ phân giải hình ảnh
CGColorRef strokeColor = [UIColor whiteColor].CGColor;
UIGraphicsBeginImageContext(imgForeground.frame.size);
CGContextRef context = UIGraphicsGetCurrentContext();
[imgForeground.image drawInRect:CGRectMake(0, 0, imgForeground.frame.size.width, imgForeground.frame.size.height)];
CGContextSetLineCap(context, kCGLineCapRound);
CGContextSetLineWidth(context, 10);
CGContextSetStrokeColorWithColor(context, strokeColor);
CGContextSetBlendMode(context, kCGBlendModeClear);
CGContextBeginPath(context);
CGContextMoveToPoint(context, lastPoint.x, lastPoint.y);
CGContextAddLineToPoint(context, currentPoint.x, currentPoint.y);
CGContextStrokePath(context);
imgForeground.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
Nhưng tôi chỉ tìm hiểu hình ảnh mất độ phân giải của nó do drawInRect.
Tải lên "trước" và "sau" hình ảnh chụp màn hình sẽ được giúp đỡ rất nhiều cho một câu hỏi liên quan đến hình ảnh. – dasblinkenlight
Tải lên hình ảnh Vui lòng tham khảo –
Không rõ ý của bạn là "mất chất lượng độ phân giải hình ảnh". Có lẽ bạn có thể cố gắng cụ thể hơn một chút. – ipmcc