swift 绘图
来源:互联网 发布:cf冰域炸服器软件 编辑:程序博客网 时间:2024/04/29 13:59
//
// zuoView.swift
// swift 仓库
//
// Created by zuo on 16/3/7.
// Copyright © 2016年 zuo. All rights reserved.
//
import UIKit
class zuoView:UIView {
overridefunc drawRect(rect: CGRect) {
super.drawRect(rect)
let context =UIGraphicsGetCurrentContext()
CGContextSetLineWidth(context,3)
CGContextSetStrokeColorWithColor(context,UIColor.purpleColor().CGColor)
CGContextMoveToPoint(context,0, 0)
CGContextAddLineToPoint(context,150, 150)
//填充它时,消耗了路径
CGContextDrawPath(context,CGPathDrawingMode.Stroke)
//绘制矩形
CGContextMoveToPoint(context,50 ,50)
//
let rect =CGRectMake(60,60, 100,100)
CGContextAddRect(context, rect)
CGContextSetFillColorWithColor(context,UIColor.purpleColor().CGColor)
CGContextDrawPath(context,CGPathDrawingMode.Fill)
}
}
- swift 绘图
- swift 绘图
- 关于IOS Swift绘图 的笔记
- 用二维数组绘图swift 2.0
- IOS-swift 动画05 CALayer绘图动画
- [Swift]使用Quartz 2D进行绘图
- iOS中常用的绘图、截屏方法(swift)
- Swift- Core Graphics绘图框架详解2(绘制图形)
- 绘图
- 绘图
- 绘图
- 绘图
- 绘图
- 绘图
- 绘图
- 绘图
- 绘图
- 绘图
- 读取配置文件乱码
- 离线安装Cloudera Manager 5和CDH5(最新版5.1.3) 完全教程
- iOS中的KVO使用
- 将matlab中数据导出VC导入
- spring 定时器配置
- swift 绘图
- Linux网络编程--服务端判断客户端断开的经验方法
- android BaseExpandableListAdapter 二级菜单适配器
- android之自定义自己的log的格式
- JavaSE入门学习27:Java常用类之String类(上)
- C++ 如何定义动态二维数组?
- salt快速部署
- Storm详解二、写第一个Storm应用
- 2048小游戏——网页版(基础篇)