Quartz 2D 是iOS 和Mac OS X中的二维绘图引擎。我们可以利用Quartz 2D API画出想要的图形效果。如:路径图,画与透明度,阴影,阴影,透明层,颜色管理,反锯齿的渲染,生成PDF文档和PDF文件元数据的访问。
谁应该阅读本文档?
本文档适用于iOS和Mac OS X开发人员需要执行下列任务:
- 画出图形
- 在一个应用程序中提供图形编辑功能
- 创建或显示位图图像
- 使用PDF文档
Organization of This Document
本文档分为以下章节:
- Overview of Quartz 2D describes the page, drawing destinations, Quartz opaque data types, graphics states, coordinates, and memory management, and it takes a look at how Quartz works “under the hood.”
- Graphics Contexts describes the kinds of drawing destinations and provides step-by-step instructions for creating all flavors of graphics contexts.
- Paths discusses the basic elements that make up paths, shows how to create and paint them, shows how to set up a clipping area, and explains how blend modes affect painting.
- Color and Color Spaces discusses color values and using alpha values for transparency, and it describes how to create a color space, set colors, create color objects, and set rendering intent.
- Transforms describes the current transformation matrix and explains how to modify it, shows how to set up affine transforms, shows how to convert between user and device space, and provides background information on the mathematical operations that Quartz performs.
- Patterns defines what a pattern and its parts are, tells how Quartz renders them, and shows how to create colored and stenciled patterns.
- Shadows describes what shadows are, explains how they work, and shows how to paint with them.
- Gradients discusses axial and radial gradients and shows how to create and use CGShading and CGGradient objects.
- Transparency Layers gives examples of what transparency layers look like, discusses how they work, and provides step-by-step instructions for implementing them.
- Data Management in Quartz 2D discusses how to move data into and out of Quartz.
- Bitmap Images and Image Masks describes what makes up a bitmap image definition and shows how to use a bitmap image as a Quartz drawing primitive. It also describes masking techniques you can use on images and shows the various effects you can achieve by using blend modes when drawing images.
- Core Graphics Layer Drawing describes how to create and use drawing layers to achieve high-performance patterned drawing or to draw offscreen.
- PDF Document Creation, Viewing, and Transforming shows how to open and view PDF documents, apply transforms to them, create a PDF file, access PDF metadata, add links, and add security features (such as password protection).
- PDF Document Parsing describes how to use CGPDFScanner and CGPDFContentStream objects to parse and inspect PDF documents.
- PostScript Conversion gives an overview of the functions you can use in Mac OS X to convert a PostScript file to a PDF document. These functions are not available in iOS.
- Text describes Quartz 2D low-level support for text and glyphs, and alternatives that provide higher-level and Unicode text support. It also discusses how to copy font variations.
- Glossary defines the terms used in this guide.