iPhone中的剪切技巧: 
1.获取图形上下文 
2.构造剪切的路径(形状)

3.构建剪切区域 
4.贴上你的画

 

 

Java代码 
  1. // 1  
  2. CGContextRef context = UIGraphicsGetCurrentContext();  
  3.   
  4. // 2  
  5. CGRect bounds = CGRectMake(0.0f, 0.0f, SIDELENGTH, SIDELENGTH);  
  6. CGMutablePathRef path = CGPathCreateMutable();  
  7. CGPathAddEllipseInRect(path, NULL, bounds);  
  8.   
  9. // 3  
  10. CGContextAddPath(context, path);  
  11. CGContextClip(context);  
  12.   
  13. // 4  
  14. [LOGO drawInRect:bounds];  

相关文章:

  • 2022-12-23
  • 2021-07-19
  • 2021-11-08
  • 2021-05-30
  • 2021-10-26
猜你喜欢
  • 2022-12-23
  • 2021-08-04
  • 2021-12-20
  • 2021-08-17
  • 2022-02-12
  • 2021-07-24
相关资源
相似解决方案