1. CGContext类。
2. UIView::DrawRect函数
3. UIGraphicsGetCurrentContext()函数
4. UIView坐标系和Quartz坐标系相反。
5. CGContextRef myContext = [[NSGraphicsContext currentContext] graphicsPort];
6. initWithFrame, intWithCoder, DrawRect
7. CGPDFContextCreateWithURL, CGPDFContextCreate
CFURLCreateWithFileSystemPath(), CGDataConsumerCreateWithURL()
8. iOS 推荐使用 UIGraphicsBeginImageContextWithOptions,它会自动做Quartz和UIKit之间的坐标变换。
9. CGBitmapContextCreate
10. Pixel Format
NULL color space:
- kCGImageAlphaoOnly 8bpp = A8
Gray color space:
- kCGImageAlphaNone 8bpp = L8
- kCGImageAlphaOnly 8bpp = A8
- kCGImageAlphaNone 16bpp = L16
- KCGImageAlphaNone|kCGBitmapfloatComponents = L32F
RGB color space:
- kCGImageAlphaNoneSkipFirst, 16bpp, 5bpc = R5G5B5X1
- kCGImageAlphaNoneSkipFirst, 32bpp, 8bpc = R8G8B8X8
- kCGImageAlphaNoneSkipLast, 32bpp, 8bpc = X8R8G8B8
- kCGImageAlphaPremultipliedFirst, 32bpp, 8bpc = R8G8B8A8
- kCGImageAlphaPremultipliedLast, 32bpp, 8bpc = A8R8G8B8
- kCGImageAlphaPremultipledLast, 64bpp, 16bpc = A16R16G16B16
- kCGImageAlphaNonSkipLast, 64bpp, 16bpc = X16R16G16B16
- kCGImageAlphaNoneSkipLast|kCGBitmapFloatComponents, 128bpp, 32bpc = X32R32G32B32F
- kCGImageAlphaPremultipliedLast | kCGBitmapFloatComponents, 128bpp, 32bpc = A32R32G32B32F
CMYK space:
- kCGImageAlphaNone 32bpp, 8bpc = C8M8Y8K8
- kCGImageAlphaNone 64bpp, 16bpx = C16M16Y16K16
- kCGImageAlphaNone|kCGBitmapFloatComponents = C32M32Y32K32F
11. CGContextSetShouldAntialias for bitmap context, CGContextSetAllowAntialasing for graphics context.