当前位置: 编程技术>移动开发
本页文章导读:
▪经过线程来处理耗时的操作:比如从服务器获取数据 通过线程来处理耗时的操作:比如从服务器获取数据
final ProgressDialog m_Dialog = ProgressDialog.show(
InComeTaskDealView.this, null, "正在加载公文详情...", true);
/* 保存到数据库 */
new Thread() {
publ.........
▪ (转)UNITY3D 3.4 FOR MAC 破译步骤图文详解 (转)UNITY3D 3.4 FOR MAC 破解步骤图文详解
链接:http://www.cnblogs.com/CallmePandora/articles/Unity3D.html
解压出Unity文件(下载地址),进入终端执行一下操作(获得root用户权限):
sudo su
提示输入密码,此时输.........
▪ 鼠标搬动划线 鼠标移动划线
PaintView.hCGPoint lastPoint;UIImageView *lineImageView;PaintView.m- (id)initWithFrame:(CGRect)frame{ self = [super initWithFrame:frame]; if (self) { lineImageView = [[UIImageView alloc] initWithF.........
[1]经过线程来处理耗时的操作:比如从服务器获取数据
来源: 互联网 发布时间: 2014-02-18
通过线程来处理耗时的操作:比如从服务器获取数据
final ProgressDialog m_Dialog = ProgressDialog.show( InComeTaskDealView.this, null, "正在加载公文详情...", true); /* 保存到数据库 */ new Thread() { public void run() { try { sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } doInHandler(2, ""); m_Dialog.dismiss(); }; }.start();
public void doInHandler(final int type, final String msg) { handler.post(new Runnable() { public void run() { switch (type) { case 1: Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_SHORT).show(); break; case 2: dealinthread(); break; } } }); } private void dealinthread() { //访问服务器 }
[2] (转)UNITY3D 3.4 FOR MAC 破译步骤图文详解
来源: 互联网 发布时间: 2014-02-18
(转)UNITY3D 3.4 FOR MAC 破解步骤图文详解
链接:http://www.cnblogs.com/CallmePandora/articles/Unity3D.html
解压出Unity文件(下载地址),进入终端执行一下操作(获得root用户权限):
sudo su
提示输入密码,此时输入你系统的登陆密码,准确地输入即可,没有回显(就是没有星号)
然后cd,进入到解压出的Unity所在的目录,输入:
chmod +x Unity
(注:这里之前写反了,赋予权限应该是+号)
给Unity赋予执行的权限,执行完之后就可以看到Unity文件的图标已经由白色变成灰色(如下)
-->
然后把终端放一边,打开Applications文件夹->Unity->Unity.app,选中Unity.app右键,选择Show Package Contents,在打开的文件夹中一次进入->Contents->MacOS文件夹,里边有一个Unity文件,copy出来(防止人品爆发破解没成功回来找我,真没成功就再copy回来)然后将刚才解压出的Unity文件copy进来,关闭文件夹,打开Unity,查看右上角的About Unity,就可以看到各种Pro了(如下)…
祝君好运!
[3] 鼠标搬动划线
来源: 互联网 发布时间: 2014-02-18
鼠标移动划线
PaintView.h
CGPoint lastPoint;
UIImageView *lineImageView;
PaintView.m
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self)
{
lineImageView = [[UIImageView alloc] initWithFrame:frame];
lineImageView.backgroundColor = [UIColor grayColor];
[self addSubview:lineImageView];
}
return self;
}
- (void)drawRect:(CGRect)rect
{
CGContextRef c = UIGraphicsGetCurrentContext(); // 获取当前的设备上下文,必须在drawRect中获取,否则会出错
CGContextSetLineCap(context, kCGLineCapRound); // 设置划线样式
CGContextSetLineWidth(context, 6);
CGContextSetRGBStrokeColor(context, 0, 0, 0, 1); // 设置画出的线的颜色信息
CGContextBeginPath(context);
CGContextMoveToPoint(context, 10, 10);
CGContextAddLineToPoint(context, 100, 100);
CGContextStrokePath(context); // 绘出图形
[super drawRect:rect];
}
// 移动鼠标划线
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *aTouch = [touches anyObject];
lastPoint = [aTouch locationInView:self];
CGContextSetFillColorWithColor(context, [UIColor redColor].CGColor);
CGContextSetAllowsAntialiasing(context, YES);
CGContextMoveToPoint(context, 0, 15);
CGContextAddEllipseInRect(context, CGRectMake(0, 0, 70, 70));
CGContextDrawPath(context, 1);
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *aTouch = [touches anyObject];
CGPoint currentPoint = [aTouch locationInView:self];
UIGraphicsBeginImageContext(self.frame.size); // 创建一个bitmap设备上下文 如果不创建,UIGraphicsGetCurrentContext()不能获取当前设备上下文
[lineImageView.image drawInRect:CGRectMake(0, 0, 768, 1024)]; // 设置图形的显示区域
CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);
CGContextSetLineWidth(UIGraphicsGetCurrentContext(), 7);
CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), 1.0, 1.0, 1.0, 1.0);
CGContextBeginPath(UIGraphicsGetCurrentContext());
CGContextMoveToPoint(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y);
CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), currentPoint.x, currentPoint.y);
CGContextStrokePath(UIGraphicsGetCurrentContext());
[lineImageView setImage:UIGraphicsGetImageFromCurrentImageContext()];
UIGraphicsEndImageContext(); // 关闭创建的设备上下文
lastPoint = currentPoint;
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
UIGraphicsBeginImageContext(self.frame.size);
[lineImageView.image drawInRect:CGRectMake(0, 0, 768, 1024)];
CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);
CGContextSetLineWidth(UIGraphicsGetCurrentContext(), 7);
CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), 1.0, 1.0, 1.0, 1.0);
CGContextMoveToPoint(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y);
CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y);
CGContextStrokePath(UIGraphicsGetCurrentContext());
CGContextFlush(UIGraphicsGetCurrentContext());
[lineImageView setImage:UIGraphicsGetImageFromCurrentImageContext()];
UIGraphicsEndImageContext();
}
PaintView.h
CGPoint lastPoint;
UIImageView *lineImageView;
PaintView.m
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self)
{
lineImageView = [[UIImageView alloc] initWithFrame:frame];
lineImageView.backgroundColor = [UIColor grayColor];
[self addSubview:lineImageView];
}
return self;
}
- (void)drawRect:(CGRect)rect
{
CGContextRef c = UIGraphicsGetCurrentContext(); // 获取当前的设备上下文,必须在drawRect中获取,否则会出错
CGContextSetLineCap(context, kCGLineCapRound); // 设置划线样式
CGContextSetLineWidth(context, 6);
CGContextSetRGBStrokeColor(context, 0, 0, 0, 1); // 设置画出的线的颜色信息
CGContextBeginPath(context);
CGContextMoveToPoint(context, 10, 10);
CGContextAddLineToPoint(context, 100, 100);
CGContextStrokePath(context); // 绘出图形
[super drawRect:rect];
}
// 移动鼠标划线
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *aTouch = [touches anyObject];
lastPoint = [aTouch locationInView:self];
CGContextSetFillColorWithColor(context, [UIColor redColor].CGColor);
CGContextSetAllowsAntialiasing(context, YES);
CGContextMoveToPoint(context, 0, 15);
CGContextAddEllipseInRect(context, CGRectMake(0, 0, 70, 70));
CGContextDrawPath(context, 1);
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *aTouch = [touches anyObject];
CGPoint currentPoint = [aTouch locationInView:self];
UIGraphicsBeginImageContext(self.frame.size); // 创建一个bitmap设备上下文 如果不创建,UIGraphicsGetCurrentContext()不能获取当前设备上下文
[lineImageView.image drawInRect:CGRectMake(0, 0, 768, 1024)]; // 设置图形的显示区域
CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);
CGContextSetLineWidth(UIGraphicsGetCurrentContext(), 7);
CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), 1.0, 1.0, 1.0, 1.0);
CGContextBeginPath(UIGraphicsGetCurrentContext());
CGContextMoveToPoint(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y);
CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), currentPoint.x, currentPoint.y);
CGContextStrokePath(UIGraphicsGetCurrentContext());
[lineImageView setImage:UIGraphicsGetImageFromCurrentImageContext()];
UIGraphicsEndImageContext(); // 关闭创建的设备上下文
lastPoint = currentPoint;
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
UIGraphicsBeginImageContext(self.frame.size);
[lineImageView.image drawInRect:CGRectMake(0, 0, 768, 1024)];
CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);
CGContextSetLineWidth(UIGraphicsGetCurrentContext(), 7);
CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), 1.0, 1.0, 1.0, 1.0);
CGContextMoveToPoint(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y);
CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y);
CGContextStrokePath(UIGraphicsGetCurrentContext());
CGContextFlush(UIGraphicsGetCurrentContext());
[lineImageView setImage:UIGraphicsGetImageFromCurrentImageContext()];
UIGraphicsEndImageContext();
}
最新技术文章: