-(UIImage*) OriginImage:(UIImage *)image scaleToSize:(CGSize)size
{
    UIGraphicsBeginImageContext(size);  //size 为CGSize类型,即你所需要的图片尺寸
    
    [image drawInRect:CGRectMake(0, 0, size.width, size.height)];  
    
    UIImage* scaledImage = UIGraphicsGetImageFromCurrentImageContext();  
    
    UIGraphicsEndImageContext();  
    
    return scaledImage;   //返回的就是已经改变的图片
}

 

相关文章:

  • 2021-07-08
  • 2021-08-28
  • 2022-12-23
  • 2022-12-23
  • 2021-09-29
  • 2021-12-26
  • 2022-01-17
猜你喜欢
  • 2021-11-22
  • 2021-07-03
  • 2021-11-22
  • 2021-06-17
  • 2021-10-13
相关资源
相似解决方案