随笔分类 -  android

摘要:@Override public boolean onKeyDown(int keyCode, KeyEvent event) { //判断是否按下返回键,event.getRepeatCount() == 0为防止点击的过快 if(keyCode==KeyEvent.KEYCODE_BACK&... 阅读全文
posted @ 2014-08-02 21:20 单方面 阅读(416) 评论(0) 推荐(0)
摘要:/*** 缓冲区工具类*/public class BufferUtil {/** * 将浮点数组转换成字节缓冲区 */public static ByteBuffer arr2ByteBuffer(float[] arr){ByteBuffer ibb = ByteBuffer.allocateD... 阅读全文
posted @ 2014-06-30 23:06 单方面 阅读(505) 评论(0) 推荐(0)
摘要:/*** 缓冲区工具类*/public class BufferUtil {/** * 将浮点数组转换成字节缓冲区 */public static ByteBuffer arr2ByteBuffer(float[] arr){ByteBuffer ibb = ByteBuffer.allocateD... 阅读全文
posted @ 2014-06-30 22:54 单方面 阅读(806) 评论(0) 推荐(0)
摘要:/** * 入门,三角形 *///自定义渲染器class MyRenderer implements android.opengl.GLSurfaceView.Renderer{private float ratio;//表层创建时public void onSurfaceCreated(GL10 ... 阅读全文
posted @ 2014-06-30 22:47 单方面 阅读(185) 评论(0) 推荐(0)
摘要:/*** 缓冲区工具类*/public class BufferUtil {/** * 将浮点数组转换成字节缓冲区 */public static ByteBuffer arr2ByteBuffer(float[] arr){ByteBuffer ibb = ByteBuffer.allocateD... 阅读全文
posted @ 2014-06-30 22:40 单方面 阅读(400) 评论(0) 推荐(0)
摘要:/*** 缓冲区工具类*/public class BufferUtil {/** * 将浮点数组转换成字节缓冲区 */public static ByteBuffer arr2ByteBuffer(float[] arr){ByteBuffer ibb = ByteBuffer.allocateD... 阅读全文
posted @ 2014-06-30 22:32 单方面 阅读(900) 评论(0) 推荐(0)
摘要:/** * 缓冲区工具类 */public class BufferUtil { /** * 将浮点数组转换成字节缓冲区 */ public static ByteBuffer arr2ByteBuffer(float[] arr){ ByteBuffer ibb = ByteBuffer.allo... 阅读全文
posted @ 2014-06-30 21:42 单方面 阅读(222) 评论(0) 推荐(0)
摘要:/*** 缓冲区工具类*/public class BufferUtil {/** * 将浮点数组转换成字节缓冲区 */public static ByteBuffer arr2ByteBuffer(float[] arr){ByteBuffer ibb = ByteBuffer.allocateD... 阅读全文
posted @ 2014-06-30 21:26 单方面 阅读(1177) 评论(0) 推荐(0)
摘要:使用openGL步骤:1.创建GLSurfaceView对象2.创建GLSurfaceView.renderer实现类.3.设置activity的contentView,以及设置view的render对象.4.实现render类的过程.a.onSurfaceCreate()方法1.设置清屏的颜色和启... 阅读全文
posted @ 2014-06-30 21:13 单方面 阅读(3493) 评论(0) 推荐(0)
摘要:知识点BitmapShader:位图的渲染LinearGradient:线性渲染ComposeShader:混合渲染RadialGradient:环形渲染SweepGradient:梯形渲染1.PorterDuff.Mode.CLEAR 所绘制不会提交到画布上。 2.PorterDuff.Mode... 阅读全文
posted @ 2014-06-25 18:57 单方面 阅读(377) 评论(0) 推荐(0)
摘要:postScale:设置图片的缩放packagecom.example.examples_05_09;importandroid.R.integer;importandroid.annotation.SuppressLint;importandroid.content.Context;importa... 阅读全文
posted @ 2014-06-25 18:52 单方面 阅读(205) 评论(0) 推荐(0)
摘要:知识点Matrix:旋转对象Reset:重载createBitmap:创建位图//代码示例packagecom.example.examples_05_08;importandroid.content.Context;importandroid.graphics.Bitmap;importandro... 阅读全文
posted @ 2014-06-25 18:50 单方面 阅读(187) 评论(0) 推荐(0)
摘要:packagecom.example.examples_05_12;importandroid.content.Context;importandroid.graphics.Bitmap;importandroid.graphics.Bitmap.Config;importandroid.graph... 阅读全文
posted @ 2014-06-25 18:49 单方面 阅读(444) 评论(0) 推荐(0)
摘要:packagecom.example.examples_05_14;importandroid.os.Bundle;importandroid.app.Activity;importandroid.util.DisplayMetrics;importandroid.view.Menu;importa... 阅读全文
posted @ 2014-06-25 18:42 单方面 阅读(303) 评论(0) 推荐(0)
摘要:知识点Alpha:渐变透明度动画效果Scale:渐变尺寸伸缩动画效果Translate:移动效果Rotate:旋转效果1、AlphaAnimation(floatfromAlpha,floattoAlpha)功能:构建一个渐变透明度动画参数:fromAlpha:为动画的起始透明度,toAlpha:终... 阅读全文
posted @ 2014-06-25 18:38 单方面 阅读(581) 评论(0) 推荐(0)
摘要:packagecom.example.examples_05_17;importandroid.R.drawable;importandroid.R.integer;importandroid.content.Context;importandroid.graphics.Canvas;importa... 阅读全文
posted @ 2014-06-25 18:35 单方面 阅读(351) 评论(0) 推荐(0)
摘要:android 模拟器手机如何添加文件到sd卡?在DDMS中直接添加文件到模拟器sd卡如果出现错误类似:Failed to push XXXXX.txt on emulator- : Read-only file system的错误,原因是你的sdcard权限不够,需要直接创建一个SDCARD 。一... 阅读全文
posted @ 2014-06-25 00:28 单方面 阅读(2246) 评论(0) 推荐(0)
摘要:packagecom.example.examples_05_07;importandroid.content.Context;importandroid.graphics.Bitmap;importandroid.graphics.Canvas;importandroid.graphics.Col... 阅读全文
posted @ 2014-06-25 00:25 单方面 阅读(614) 评论(0) 推荐(0)
摘要:drawRect:矩形drawCircle:绘制圆形drawOval:椭圆drawPath:任意多边形drawLine:直线drawPoint:绘制点代码示例第一种packagecom.example.examples_05_05;importandroid.annotation.SuppressL... 阅读全文
posted @ 2014-06-25 00:23 单方面 阅读(1436) 评论(0) 推荐(0)
摘要:publicclassMainActivityextendsActivity{ GrameViewgrameView;@OverridepublicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);gr... 阅读全文
posted @ 2014-06-25 00:20 单方面 阅读(363) 评论(0) 推荐(0)