摘要: 大多数与java一致,唯一差别在布尔类型,以及字符串上,下面详细说明:布尔型:用的 bool 来表示,它的赋值为 bool=true=1; 或者bool=false=0;//这里可以直接设置数字 或者设置true false性质一样双字节型://需要导入自带的locale函数库#include <locale>//设置本地语言,第一个参数LC_ALL代表设置全部,chs代表简体中文setlocale(LC_ALL,"chs");wchar_t wt[]=L"中"; //首先类型是wchar_t 其次这个是数组类型[] 第三需要在中文前面加L 阅读全文
posted @ 2013-02-21 09:48 王世桢 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 本人之前是做java的,所以对于c++这里只会总结一下与java的不同之处,如果要学习c++的全部内容,可以转到地址http://pcedu.pconline.com.cn/videoedu/asp/0906/1682266.html 阅读全文
posted @ 2013-02-21 09:29 王世桢 阅读(124) 评论(0) 推荐(0) 编辑
摘要: android本事是支持的,很简单 就直接上代码了 1 @Override 2 public boolean onTouchEvent(MotionEvent event) { 3 4 switch (event.getAction()&MotionEvent.ACTION_MASK) { 5 case MotionEvent.ACTION_DOWN: 6 Log.e(TAG, "按下了"); 7 break; 8 case Motion... 阅读全文
posted @ 2013-02-01 10:07 王世桢 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 比较简单就直接上代码了 1 package cn.itcast.mobilesafe; 2 3 import android.app.Activity; 4 import android.content.SharedPreferences; 5 import android.content.SharedPreferences.Editor; 6 import android.os.Bundle; 7 import android.os.Environment; 8 import android.util.Log; 9 import android.view.Display;... 阅读全文
posted @ 2013-01-31 11:17 王世桢 阅读(516) 评论(0) 推荐(0) 编辑
摘要: 数据缓存的两种方法:1.数据缓存到/data/data目录(ROM) 数据缓存到手机的sd卡上特殊的业务场景,不允许把缓存数据存到手机的rom或者sd卡上2.把资源文件缓存到内存(RAM)里面,保证了数据的安全性,并且不会占用、多用的外存储空间1 private Map<String,Bitmap> bitmapCache;2 bitmapCache=new HashMap<String,Bitmap>();每一次显示图片的时候,首先判断map缓存集合里面是否存在缓存的图片对象1 OutOfMemoryException();软引用:特殊的引用类型,当java虚拟机内存 阅读全文
posted @ 2013-01-29 14:52 王世桢 阅读(1106) 评论(0) 推荐(0) 编辑
摘要: 布局文件 1 <?xml version="1.0" encoding="utf-8"?> 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 android:layout_width="fill_parent" 4 android:layout_height="fill_parent" 5 android:orientation="vertical" &g 阅读全文
posted @ 2013-01-27 16:22 王世桢 阅读(389) 评论(0) 推荐(0) 编辑
摘要: 1 package cn.itcast.welcome; 2 3 import android.content.Context; 4 import android.graphics.Canvas; 5 import android.graphics.Color; 6 import android.graphics.Paint; 7 import android.graphics.Path; 8 import android.graphics.Typeface; 9 import android.view.View;10 11 public class MyView extends View.. 阅读全文
posted @ 2013-01-27 16:15 王世桢 阅读(517) 评论(0) 推荐(0) 编辑
摘要: 1 package cn.itcast.bitmapcopy; 2 3 import java.io.FileNotFoundException; 4 5 import android.app.Activity; 6 import android.content.Intent; 7 import android.graphics.Bitmap; 8 import android.graphics.BitmapFactory; 9 import android.graphics.Canvas;10 import android.graphics.ColorMatrix;11 import ... 阅读全文
posted @ 2013-01-27 15:24 王世桢 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 就是利用ColorMatrx来进行改变 1 @Override 2 protected void onActivityResult(int requestCode, int resultCode, Intent data) { 3 try { 4 if (data != null) { 5 // 得到点击图片的uri 6 Uri uri = data.getData(); 7 //原图 8 Bitmap bitmap =... 阅读全文
posted @ 2013-01-27 14:33 王世桢 阅读(260) 评论(0) 推荐(0) 编辑
摘要: Matrix是一个矩阵1 Matrix matrix=new Matrix();2 matrix.setValues(new float[]{3 2,0,0,4 0,1,0,5 0,0,1 6 });7 x=2x+0y+0z;8 y=0x+1y+0z;9 z=0x+0y+1z; //z越大离用户越远算法不清楚的可以直接用代码操作1 //matrix.setScale(sx, sy);旋转的话也可以直接用代码1 1 //matrix.setRotate(30);//旋转30度 可以通过画笔来取消锯齿,但是效果不是很好1... 阅读全文
posted @ 2013-01-27 14:25 王世桢 阅读(310) 评论(0) 推荐(0) 编辑