//获取图片

 

+ (UIImage*) getImageWithColor:(UIColor*)color andHeight:(CGFloat)height

{

  CGRect r= CGRectMake(0.0f, 0.0f, 1.0f, height);

  UIGraphicsBeginImageContext(r.size);

  CGContextRef context = UIGraphicsGetCurrentContext();

  

  CGContextSetFillColorWithColor(context, [color CGColor]);

  CGContextFillRect(context, r);

  

  UIImage *img = UIGraphicsGetImageFromCurrentImageContext();

  UIGraphicsEndImageContext();

  return img;

}

相关文章:

  • 2021-07-26
  • 2022-12-23
  • 2022-01-01
  • 2022-12-23
  • 2021-05-19
  • 2021-10-25
猜你喜欢
  • 2022-12-23
  • 2021-10-23
  • 2021-10-14
  • 2021-11-06
  • 2021-08-16
  • 2021-06-28
相关资源
相似解决方案