2D Z 2D drawing and quartz2d drawing
Quartz 2D drawing can only be rewritten to drawRect in UIView: This method is used for drawing. It is invalid in other places and an error is returned.
Drawing Process:
1. Obtain the context CGContextRef context = UIGraphicsGetCurrentContext ();
2. Add the graph CGContextAddRect (context, CGRectMake (50, 50,100,100 ));
3. Draw the graph CGContextDrawPath (context, kCGPathEOFill );
4. Disable the context CGContextClosePath (context );
Quartz 2D Coordinate System Transformation
1. The CGContextRotateCTM (CGContextRef c, CGFloat angle) method can rotate the context coordinate system relative to the origin.
2. The CGContextTranslateCTM (CGContextRef c, CGFloat tx, CGFloat ty) method can translate the context coordinate system relative to the origin.
3. The CGContextScaleCTM (CGContextRef c, CGFloat sx, CGFloat sy) method can scale the context coordinate system.
Note:
Use CGContextSaveGState (CGContextRef c) to save the current context status before converting the Coordinate System
After the coordinate system is converted, you can use CGContextRestoreGState (CGContextRef c) to restore the previously saved context status.
Quartz basic Plotting Method
CGContextBeginPath start a new path CGContextMoveToPoint set path start CGContextClosePath close path CGContextAddPath add path else add line CGContextAddLines add multiple lines CGContextAddRect add rectangle CGContextAddRects add multiple rectangles else add in the rectangle area elliptical CGContextAddArc add an arc CGContextAddArcToPoint add an arc CGContextAddCurveToPoint cgcgcgcontextdrawpath Add a curve CGContextDrawPath Add a solid path CGContextFillPath Add a solid rectangle CGContextFillRects multiple solid rectangles drawing a solid elliptical CGContextStrokePath path CGContextStrokeRect hollow rectangle fill draw hollow rectangle using width fill draw hollow rectangle fill draw hollow elliptical CGContextSetLineWidth Set width CGContextSetBlendMode set mixed mode fill set anti-sawtooth effect CGContextSetLineCap set Line ending point style CGContextSetLineJoin set line connection point style CGContextSetLineDash
What does quartz do? In what ways?
It is generally used for regular job scheduling. For example, to execute a xx operation every Sunday, it is to start a thread in the background.
What graphics software is easy to use? 2D plotting software that can be colored
To draw cartoons, use COMICSTUDIO. If you just draw a single PHOTOSHOP, PAINTER, or SAI, you can