- 开启一个基于位图的图形上下文
/*
size :大小
opaque : YES:不透明 NO:透明
scale: 缩放比例
*/
void UIGraphicsBeginImageContextWithOptions(CGSize size, BOOL opaque, CGFloat scale)
- 从上下文中取得图片(UIImage)
UIImage* UIGraphicsGetImageFromCurrentImageContext();
- 结束基于位图的图形上下文
void UIGraphicsEndImageContext();
- 图片裁剪
void CGContextClip(CGContextRef c)
将当前上下所绘制的路径裁剪出来(超出这个裁剪区域的都不能显示)
本文介绍了如何使用UIGraphicsBeginImageContextWithOptions创建基于位图的图形上下文,并提供了获取当前上下文中的UIImage的方法,同时也讨论了如何结束上下文以及进行图片裁剪。
38

被折叠的 条评论
为什么被折叠?



