Reference
[1] http://stackoverflow.com/questions/1877987/whats-the-difference-between-quartz-core-core-graphics-and-quartz-2d
Quartz 2D is part of core graphic. quartz is a set of functions, data types, and objects. It is designed to directly draw views or images in memory.
The quartz 2D API is part of the core graphics framework, so you may see quartz referred to as core graphics
Or, simply, CG.
Quartz core is an interface for processing animation core animation, images, and videos.
This collection
Of documents provides the API reference for the quartz core framework, which supports image processing and video image manipulation.
The default coordinate origin of quartz is in the lower left corner, which is different from that of uiview and uiwindow (in the upper left corner. Although the coordinate system used by quartz does not use the upper left corner as the origin, this is not a problem for many quartz calls. In the call viewdrawRect:
Before using this method, uikit automatically configures the plotting environment to make the upper-left corner the origin of the coordinate system. The quartz call in this environment can be correctly traced in the view. The only scenario where you need to consider the differences between different coordinate systems is when you create an environment for Plotting through quartz.
Important:Because the lower-left origin is used for plotting in the bitmap or PDF context, the coordinate system must be compensated when the plotting result is rendered to the view. In other words, if you create an image and callCGContextDrawImage
Function, the image is reversed by default. To correct this problem, you must flip the Y axis of the CTM (multiply this value-1
) To move its origin point from the lower left corner to the upper left corner of the view.
If you useUIImage
Object To encapsulateCGImageRef
Type, you do not need to modify the CTM.UIImage
The object will automaticallyCGImageRef
Type Coordinate System for flip compensation.