生成获得一个Context
UIGraphicsGetCurrentContext:获得当前的context,通常使用在drawRect
UIGraphicsBeginImageContextWithOptions:生成一个bitmap context ,通过UIGraphicsGetCurrentContext获得上下文
CGBitmapContextCreate: 生成一个bitmap context
生成获得UIImage,CGImage
UIGraphicsGetImageFromCurrentImageContext 从当前context返回UIImage
CGBitmapContextCreateImage 从context返回CGImage
+(UIImage)imageWithCGImage:scale:orientation:通过CGImage返回UIImage
截取,mask,绘制图片
CGImageCreateWithImageInRect: 截图
CGImageCreateWithMask:创建mask显示
CGImageCreateWithMaskingColors: 用颜色范围来mask一张图片
CGContextClipToRect + CGContextDrawImage + 截取context位置,在context当中绘图,然后从context返回图片