package com.brady.est;import android.annotation.SuppressLint;import android.graphics.Bitmap;import android.graphics.drawable.BitmapDrawable;import and...
分类:
其他好文 时间:
2014-10-31 11:27:00
阅读次数:
266
在做项目的过程中发现Bitmap不能被序列化,下面是一种能把bitmap转为字节数组进行传递的过程,记下来,备用。//第一句是我获得我model里的bitmapBitmap bmp=((BitmapDrawable)list.get(position).getAppIcon()).getBitmap...
分类:
其他好文 时间:
2014-10-28 21:35:48
阅读次数:
186
开发图片视频应用常遇到这个错误。
android
内存由 dalvik 和 native 2部分组成,dalvik 也就是 java 堆,创建的对象就是在这里分配的,
而
native 是通过 c/c++ 方式申请的内存,
Bitmap
就是以一种方式分配的(android3.0 以后,系统默认是通过 dalvik 分配的)。当然无论以何种方式分
...
分类:
移动开发 时间:
2014-10-28 15:35:57
阅读次数:
160
内存溢出主要由以下几种情况引起:1.数据库的cursor没有关闭。2.构造adapter没有使用缓存contentview。3.调用registerReceiver后未调用unregisterReceiver()。4.未关闭InputStream/OutputStream。5.Bitmap使用后未调...
分类:
移动开发 时间:
2014-10-27 19:20:09
阅读次数:
134
private void SaveImageToSysAlbum() {
if (FileUtil.isSdCardExist()) {
BitmapDrawable bmpDrawable = (BitmapDrawable)mFullImageView.getDrawable();
Bitmap bmp = bmpDrawable.getBitmap();
if (bmp...
分类:
其他好文 时间:
2014-10-27 12:48:42
阅读次数:
265
开发android wear程序时,经常需要将图片通过Assets 蓝牙传输。
1.创建asset,使用create...()方法,比如传递一个Bitmap传输如下
private static Asset createAssetFromBitmap(Bitmap bitmap) {
final ByteArrayOutputStream byteStream = new ByteAr...
分类:
移动开发 时间:
2014-10-27 10:51:21
阅读次数:
211
(一)创建图片Bitmap的类型
BitmapFactory.Options代表Bitmap存储的方式
ALPHA_8
只有alpha值,占1字节
ARGB_4444
不推荐,ARGB各占4bits,共占2字节
ARGB_8888
默认保存方式,ARGB各占8bits,共占4字节
RGB_565
没alpha值,共占2字节...
分类:
移动开发 时间:
2014-10-27 09:21:05
阅读次数:
149
显示资源中的图片 (1)从资源中装入位图 ● 定义位图对象数据成员CBitmap m_Bitmap; ● 调用CBitmap成员函数LoadBitmap(),如m_Bitmap.LoadBitmap(IDB_BITMAP1); ● 传入LoadBitmap的参数是位图在图形编辑器中生成或从位图文件中...
分类:
编程语言 时间:
2014-10-26 22:41:27
阅读次数:
421
首先看一下GLSurfaceView是怎样绘制的。正如android开发文档中描写叙述的那样,我们须要new一个GLSurfaceView对象,然后设置一个实现了Renderer接口的对象,我们须要写一个MyRender类,实现Renderer的方法等等。我们先看一下Activity的写法。它不须要...
分类:
移动开发 时间:
2014-10-26 21:10:21
阅读次数:
314
1、主要的绘制图片方法 //Bitmap:图片对象,left:偏移左边的位置,top: 偏移顶部的位置 drawBitmap(Bitmap bitmap, float left, float top, Paint paint)2、对图片剪接和限定显示区域 drawBitmap(Bitmap bit....
分类:
移动开发 时间:
2014-10-26 15:31:06
阅读次数:
148