How erase part of UIImage

后端 未结 2 1800
旧时难觅i
旧时难觅i 2021-01-07 00:32

Is there a way to erase the black background for that image \"alt

I\'ve found this sample code found on

2条回答
  •  爱一瞬间的悲伤
    2021-01-07 00:59

    Here's how to get "erasePath". Just pass the selected CGRect you want to crop as "cropRect" -

    CGMutablePathRef erasePath = CGPathCreateMutable();
    CGPathAddRect(erasePath, NULL, cropRect);
    CGContextAddPath(g,erasePath);
    

提交回复
热议问题