Proper use of UIRectClip to scale a UIImage down to icon size

前端 未结 3 505
清酒与你
清酒与你 2021-02-06 10:07

Given a UIImage of any dimension, I wish to generate a square \"icon\" sized version, px pixels to a side, without any distortion (stretching). How

3条回答
  •  猫巷女王i
    2021-02-06 10:26

    wheeliebin answers is correct but he forgot a minus sign in front of destY

    destRect = CGRectMake(0, -destY, destSize, destHeight);
    

提交回复
热议问题