iOS画图 上下文栈的使用
来源:互联网 发布:java中的构造器是什么 编辑:程序博客网 时间:2024/06/08 01:40
//
// SCH.m
// Contextschtest1
//
// Created by tianshangrenjian on 15/6/29.
// Copyright (c) 2015年 tianshangrenjian. All rights reserved.
//
#import "SCH.h"
@implementation SCH
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
CGContextRef ctx=UIGraphicsGetCurrentContext();
CGContextSaveGState(ctx);//入栈
CGContextMoveToPoint(ctx,0, 0);
CGContextAddLineToPoint(ctx,100, 100);
CGContextAddLineToPoint(ctx,130, 80);
// CGContextStrokePath(ctx);
CGContextSetLineWidth(ctx,40);
CGContextSetLineJoin(ctx,kCGLineCapRound);//
[[UIColorredColor ] set];
CGContextStrokePath(ctx);
CGContextRestoreGState(ctx);//出栈
CGContextMoveToPoint(ctx,31, 10);
CGContextAddLineToPoint(ctx,150, 170);
CGContextAddLineToPoint(ctx,170, 180);
// CGContextStrokePath(ctx);
// CGContextSetLineWidth(ctx, 40);
CGContextSetLineJoin(ctx,kCGLineCapRound);//
[[UIColorblueColor ] set];
CGContextStrokePath(ctx);
NSString *str=@"kdfjdk";
[str drawAtPoint:CGPointMake(10,100) withAttributes:nil];
}
@end
- iOS画图 上下文栈的使用
- iOS画图中 图形上下文的管理
- iOS - 图形上下文使用
- [iOS]上下文的理解
- ios-图形上下文栈
- ios开发使用CGContextRef画图
- iOS开发 CGContextRef画图使用
- iOS画图-UIBezierPath和CAShapeLayer的简单使用
- ios UIKit的图形上下文
- iOS绘图上下文的理解。
- ios-图片类型的上下文
- Highcharts 的画图使用
- iOS开发-Quartz2D上下文栈的操作&详细分析绘图本质(图形上下文栈)
- ios画图常用的函数
- iOS-使用UIControl封装@"上下文"控件
- iOS中画图表 使用HighChart
- ios-使用CGContextRef重写drawrect画图
- 上下文菜单ContextMenu的使用
- 多态基类的析构函数应该为虚函数
- C++虚继承
- Android 自定义View
- Linux内核模块实例
- CocoaPods安装和使用教程
- iOS画图 上下文栈的使用
- ODC(Orthogonal Defect Classification)简介
- 《Java程序设计》第16周周四:GUI编程及文件对话框的使用~作业
- 消息队列的读写
- configure, Makefile.am, Makefile.in,Makefile之间的关系
- 限制app只能使用https连接,不能使用http连接
- system ():
- 3.7 百分比堆积柱形图
- C++拷贝构造函数