※效果※代码/** * 转换图片成圆形 * * @param bitmap * 传入Bitmap对象 * @return */ public Bitmap toRoundBitmap(Bitmap bitmap) { int width = bitmap.get...
分类:
其他好文 时间:
2014-08-28 21:03:06
阅读次数:
219
要点: 1、用decodeFileDescriptor()来生成bimap比decodeFile()省内存,将Bitmap bmp = BitmapFactory.decodeFile(imageFile, opts);imageView.setImageBitmap(bmp);替换为1 FileI...
分类:
其他好文 时间:
2014-08-27 16:05:28
阅读次数:
317
转载自:http://blog.csdn.net/jie_qing/article/details/7259520在学习Graphics中遇到位图(Bitmap)中getPixels()方法,对该方法的用法大体理解,但对其中的stride参数却不明白具体的用法以及用意,经过一番折腾后,有些明了,现记...
分类:
其他好文 时间:
2014-08-27 14:37:28
阅读次数:
316
32位机器上,一个整形,比如inta;在内存中占32bit位移转换(1)求十进制数0-N对应的在数组a中的下标index_loc=N/32即可,index_loc即为n对应的数组下标。例如n=76,则loc=76/32=2,因此76在a[2]中。(2)求十进制数0-N对应的bit位bit_loc=N...
分类:
其他好文 时间:
2014-08-26 22:46:56
阅读次数:
261
下面的例子演示如何使用BufferedInputStream类读取文本文件内容。首先需要声明一个byte数组作为buffer,然后循环将文本内容循环读入到buffer中,并将buffer转换为字符串,打印到控制台。/**** @author outofmemory.cn*/public class ...
分类:
其他好文 时间:
2014-08-25 19:06:44
阅读次数:
231
- (void)WaterImage{ UIImage *bgImage = [UIImage imageNamed:@"scene"]; // 上下文 : 基于位图(bitmap) , 所有的东西需要绘制到一张新的图片上去 // 1.创建一个基于位图的上下文(开启一个基于位图的上下文) // .....
分类:
移动开发 时间:
2014-08-23 21:38:41
阅读次数:
310
Android Bitmap用法大全,以后再也不担心了...
分类:
移动开发 时间:
2014-08-22 16:27:49
阅读次数:
226
@Override
public?void?onClick(View?v)?{
// if?(mBitmap?==?null)?{
// mBitmap?=?Bitmap.createBitmap(mCharView.getMeasuredWidth(),?mCharView.getMeasuredHeight(),?Bitmap.Config.ARGB_88...
分类:
其他好文 时间:
2014-08-22 14:39:59
阅读次数:
238
一、Bitmap转Drawable
Bitmap bm=xxx; //xxx根据你的情况获取
BitmapDrawable bd=new BitmapDrawable(bm);
因为BtimapDrawable是Drawable的子类,最终直接使用bd对象即可。
二、 Drawable转Bitmap
转成Bitmap对象后,可以将Drawable对象通过Android的SK库存成一个字节...
分类:
其他好文 时间:
2014-08-22 13:05:48
阅读次数:
219