码迷,mamicode.com
首页 >  
搜索关键字:rect    ( 5022个结果
go 语言学习笔计之结构体
go 语言中的结构体方法结构体名称的大小写有着不同的意义: 小写表示不能被别的包访问package mainimport "fmt"type Rect struct { width,height int}func (r *Rect) area() int { return r.width*r.hei...
分类:编程语言   时间:2015-07-10 12:53:15    阅读次数:141
scrollview滚动到指定区域的两种方法
方法一:利用偏移量来滚动- (void)setContentOffset:(CGPoint)contentOffset animated:(BOOL)animated;方法二:利用rect来滚动- (void)scrollRectToVisible:(CGRect)rect animated:(BO...
分类:其他好文   时间:2015-07-08 02:04:44    阅读次数:500
iOS下划线/虚线/删除线等等
1.实线,(下划线/删除线) 写一个新类 UnderLineLabel : UILabel - (void)drawRect:(CGRect)rect { // Drawing code [super drawRect:rect]; CGContextRef ctx = UIGraphicsGetCurrentContext(); CGSize f...
分类:移动开发   时间:2015-07-07 11:08:01    阅读次数:253
GO语言练习:struct基础练习
1、代码2、运行1、代码 1 package main 2 3 import "fmt" 4 5 type Rect struct { 6 x, y float64 7 width, height float64 8 } 9 10 func (r * Rect) Area() f...
分类:编程语言   时间:2015-07-06 22:59:48    阅读次数:180
UIColor和UIImage转换
UIColor 转UIImage - (UIImage*) createImageWithColor: (UIColor*) color {     CGRect rect=CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);     UIGraphicsBeginImageContext(rect.size);     CGContextRef c...
分类:其他好文   时间:2015-07-05 16:55:50    阅读次数:160
iOS开发总结(A0)- Create UIImge based on UIView
可用以下代码:UIGraphicsBeginImageContextWithOptions(size, opaque, scale);// code[view drawViewHierarchyInRect:rect afterScreenUpdates:YesOrNo];UIImage *imag...
分类:移动开发   时间:2015-07-05 07:02:39    阅读次数:160
利用Quartz2D推图的另一个方法 (使用CGMutalePathRef进行分层次)
可以利用 CGMutablePathRef 创建每个不同图形,然后再一起添加到CGContext中- (void)drawRect:(CGRect)rect{ CGContextRef ctx = UIGraphicsGetCurrentContext(); //一、 画线 ...
分类:Web程序   时间:2015-07-02 20:48:18    阅读次数:151
绘制图形-移动,旋转,阴影,渐变
// Only override drawRect: if you perform custom drawing. // An empty implementation adversely affects performance during animation. - (void)drawRect:(CGRect)rect {     UIBezierPath *path = [UI...
分类:移动开发   时间:2015-07-01 22:19:53    阅读次数:259
ios绘图
#import "LCSView.h" @implementation LCSView ////绘图 - (void)drawRect:(CGRect)rect {      #if 0     //图形上下文对象     CGContextRef context = UIGraphicsGetCurrentContext();  ...
分类:移动开发   时间:2015-06-30 18:21:10    阅读次数:221
pyglet----画一个矩形
这里列出一种在窗口Window中画图的程序框架。。。。。。。。。。#-*- coding:utf-8 -*-from pyglet.gl import *def draw_rect(x, y, width, height): glBegin(GL_LINE_LOOP) glVertex2...
分类:其他好文   时间:2015-06-27 22:41:01    阅读次数:1012
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!