Drawing with Quartz and UIKit (使用 Quartz 和 UIKit 进行绘制)

Quartz is the general name for the native drawing technology in iOS. The Core Graphics framework is at the heart of Quartz, and is the primary interface you use for drawing content. This framework provides data types and functions for manipulating the following:

  • Graphics contexts
  • Paths
  • Images and bitmaps
  • Transparency layers
  • Colors, pattern colors, and color spaces
  • Gradients and shadings
  • Fonts
  • PDF content

Quartz是iOS中原生绘图技术的通用名称。 Core Graphics框架是Quartz的核心,也是您用于绘制内容的主要接口。 该框架提供了用于操作以下内容的数据类型和函数:

  • 图形上下文
  • 路径
  • 图像和位图
  • 透明层
  • 颜色,图案颜色和颜色空间
  • 渐变和阴影
  • 字体
  • PDF内容

UIKit builds on the basic features of Quartz by providing a focused set of classes for graphics-related operations. The UIKit graphics classes are not intended as a comprehensive set of drawing tools—Core Graphics already provides that. Instead, they provide drawing support for other UIKit classes. UIKit support includes the following classes and functions:

  • UIImage, which implements an immutable class for displaying images
  • UIColor, which provides basic support for device colors
  • UIFont, which provides font information for classes that need it
  • UIScreen, which provides basic information about the screen
  • UIBezierPath, which enables your app to draw lines, arcs, ovals, and other shapes.
  • Functions for generating a JPEG or PNG representation of a UIImage object
  • Functions for drawing to a bitmap graphics context
  • Functions for generating PDF data by drawing to a PDF graphics context
  • Functions for drawing rectangles and clipping the drawing area
  • Functions for changing and getting the current graphics context

UIKit通过为图形相关操作提供一组集中的类来构建Quartz的基本功能。 UIKit图形类并不是一套全面的绘图工具–Core Graphics已经提供了这些工具。相反,它们为其他UIKit类提供绘图支持。 UIKit支持包括以下类和功能:

  • UIImage,它实现了一个用于显示图像的不可变类
  • UIColor,为设备颜色提供基本支持
  • UIFont,它为需要它的类提供字体信息
  • “UIScreen”,提供有关屏幕的基本信息
  • UIBezierPath,可让您的应用程序绘制线条,圆弧,椭圆和其他形状。
  • 用于生成UIImage对象的JPEG或PNG表示的函数
  • 绘制到位图图形上下文的函数
  • 通过绘制到PDF图形上下文生成PDF数据的功能
  • 绘制矩形和剪裁绘图区域的功能
  • 用于更改和获取当前图形上下文的函数

For information about the classes and methods that comprise UIKit, see UIKit Framework Reference. For more information about the opaque types and functions that comprise the Core Graphics framework, see Core Graphics Framework Reference.

有关组成UIKit的类和方法的信息,请参阅UIKit Framework Reference。 有关构成Core Graphics框架的opaque类型和函数的更多信息,请参阅Core Graphics Framework Reference。

发布了89 篇原创文章 · 获赞 81 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/qfeung/article/details/89437260