- (void)drawRect:(CGRect)rect
2 {
3 //画四边形
4 //获取图形上下文
5 CGContextRef ctx=UIGraphicsGetCurrentContext();
6 //矩阵操作
7 //注意点:设置矩阵操作必须要在添加绘图信息之前
8 //旋转45度
9 CGContextRo...
分类:
其他好文 时间:
2016-05-12 20:40:08
阅读次数:
215
一,Java的Executor框架
1,Executor接口
public interface Executor {
void execute(Runnable command);
}Executor接口是Executor框架中最基础的部分,定义了一个用于执行Runnable的execute方法,它没有实现类只有另一个重要的子接口ExecutorService
2,Exe...
分类:
编程语言 时间:
2016-05-12 20:38:49
阅读次数:
251
## 运算符
###++ -- 的用法
1. ++a 先赋值后运算
2. a++ 先运算后赋值
例如:
public class Suanshu2{
public static void main(String[] args){
int num = 1; //声明一个变量
int num2 = 5;
int i...
分类:
编程语言 时间:
2016-05-12 20:26:41
阅读次数:
231
一、简单说明
线程间通信:在1个进程中,线程往往不是孤立存在的,多个线程之间需要经常进行通信线程间通信的体现
1个线程传递数据给另1个线程
在1个线程中执行完特定任务后,转到另1个线程继续执行任务线程间通信常用方法- (void)performSelectorOnMainThread:(SEL)aSelector withObject:(id)arg waitUntilDone:(BOOL)w...
分类:
移动开发 时间:
2016-05-12 20:23:23
阅读次数:
173
源代码1:
public class Java15 {
public static void main(String[] args) {
String s1="疯狂java";
String s2="疯狂"+"java";
System.out.println(s1==s2);
String str1="疯狂";...
分类:
其他好文 时间:
2016-05-12 20:22:05
阅读次数:
146
- (void)drawRect:(CGRect)rect
2 {
3 //获取上下文
4 CGContextRef ctx=UIGraphicsGetCurrentContext();
5 //绘图
6 //第一条线
7 CGContextMoveToPoint(ctx, 20, 100);
8 CGContextAddLineToP...
分类:
其他好文 时间:
2016-05-12 20:11:03
阅读次数:
195
1.压缩图片#pragma mark 处理图片
- (void)useImage:(UIImage *)image
{
NSLog(@"with-----%f heught-----%f",image.size.width,image.size.height);
float scales = image.size.height / image.size.width; /...
分类:
移动开发 时间:
2016-05-12 20:08:23
阅读次数:
241
目标:裁剪一张圆形图片
步骤:
1. 加载要截取的图片
2. 设置圆形裁剪区域
2.1 创建圆形的路径
2.2 把路径设置为裁剪区域
3. 绘制图片
4. 从上下文中获取图片
5. 关闭上下文
代码:
- (void)viewDidLoad {
[s...
分类:
其他好文 时间:
2016-05-12 20:01:57
阅读次数:
156
一、广播发送者&广播接收者介绍
1.广播接收者
广播接收者简单地说就是接收广播意图的Java类,此Java类继承BroadcastReceiver类,重写:
public void onReceive(Context context,Intent intent),其中intent可以获得传递的数据;
广播意图就是通过Context.sendBroadcast(Int...
分类:
其他好文 时间:
2016-05-12 19:52:58
阅读次数:
285
哎,先实现效果吧。
上代码,这段方法不需要动, 添加引用就好, #region 二维码部分
///
/// 128条码调用生成
///
/// 条码编号
private void Get128BarCode(string Ncode)
{
Code12...