0417--iOS文档之Drawing(图形绘制)

Drawing

Configure your app's drawing environment using colors, renderers, draw paths, strings, and shadows.

       --使用颜色、渲染器、绘制路径、字符串和阴影来配置应用程序的绘图环境。

 

Topics                   --专题

Color           --颜色

class UIColor

An object that stores color data and sometimes opacity.

 

Drawing Contexts               --用于绘制的上下文

Use renderers to turn a set of programmatic drawing commands into a bitmap or PDF image.

       --使用渲染器返回一系列可编程的绘制命令转换成bitmap格式或PDF格式的图片

class UIGraphicsRenderer

An abstract base class for creating graphics renderers.

class UIGraphicsRendererContext

The base class for the drawing environments associated with graphics renderers.

class UIGraphicsRendererFormat

A set of drawing attributes that represent the configuration of a graphics renderer context.

class UIGraphicsImageRenderer

A graphics renderer for creating Core Graphics-backed images.

class UIGraphicsImageRendererContext

The drawing environment associated with an image renderer.

class UIGraphicsImageRendererFormat

A set of drawing attributes that represent the configuration of an image renderer context.

class UIGraphicsPDFRenderer

A graphics renderer for creating PDFs.

typealias UIGraphicsPDFRenderer.DrawingActions

A handler block that you use to draw PDF content.

class UIGraphicsPDFRendererContext

A drawing environment associated with a PDF renderer.

class UIGraphicsPDFRendererFormat

A set of drawing attributes that represents the configuration of a PDF renderer context.

 

Paths                   --用于绘制的路径

class UIBezierPath

A path that consists of straight and curved line segments that you can render in your custom views.

func UIRectFill(CGRect)

Fills the specified rectangle with the current color.

func UIRectFillUsingBlendMode(CGRect, CGBlendMode)

Fills a rectangle with the current fill color using the specified blend mode.

func UIRectFrame(CGRect)

Draws a frame around the inside of the specified rectangle.

func UIRectFrameUsingBlendMode(CGRect, CGBlendMode)

Draws a frame around the inside of a rectangle using the specified blend mode.

 

Strings                    --字符串

class NSStringDrawingContext

An object that manages metrics used when drawing attributed strings.

struct NSStringDrawingOptions

Constants for the rendering options for a string when it is drawn.

enum UIBaselineAdjustment

Vertical adjustment options.

 

Shadows                     --阴影

class NSShadow

An encapsulation of the attributes used to create a drop shadow during drawing operations.

 

Drawing Context Primitives              --绘制的上下文的原语

Manage the current graphics environment using Core Graphics framework types.

func UIGraphicsGetCurrentContext() -> CGContext?

Returns the current graphics context.

func UIGraphicsPushContext(CGContext)

Makes the specified graphics context the current context.

func UIGraphicsPopContext()

Removes the current graphics context from the top of the stack, restoring the previous context.

func UIGraphicsBeginImageContextWithOptions(CGSize, Bool, CGFloat)

Creates a bitmap-based graphics context with the specified options.

func UIRectClip(CGRect)

Modifies the current clipping path by intersecting it with the specified rectangle.

 

Primitive Type Conversions                    --原语类型的转换

class func cgAffineTransform(for: String) -> CGAffineTransform

Returns a Core Graphics affine transform structure corresponding to the data in a given string.

class func cgPoint(for: String) -> CGPoint

Returns a Core Graphics point structure corresponding to the data in a given string.

class func cgRect(for: String) -> CGRect

Returns a Core Graphics rectangle structure corresponding to the data in a given string.

class func cgSize(for: String) -> CGSize

Returns a Core Graphics size structure corresponding to the data in a given string.

class func cgVector(for: String) -> CGVector

Returns a Core Graphics vector corresponding to the data in a given string.

class func string(for: CGAffineTransform) -> String

Returns a string formatted to contain the data from an affine transform.

class func string(for: CGPoint) -> String

Returns a string formatted to contain the data from a point.

class func string(for: CGRect) -> String

Returns a string formatted to contain the data from a rectangle.

class func string(for: CGSize) -> String

Returns a string formatted to contain the data from a size data structure.

class func string(for: CGVector) -> String

Returns a string formatted to contain the data from a vector data structure.

See Also

Graphics, Drawing, and Printing

 

Images and PDF

Create and manage images, including those that use bitmap and PDF formats.

 

Printing

Display the system print panels and manage the printing process.

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值