自己写个小程序,需求图片转马赛克.protected Bitmap mosic(Bitmap bitmap){ int bitWidth = bitmap.getWidth(); int bitHeight = bitmap.getHeight(); int...
分类:
移动开发 时间:
2014-07-10 10:17:35
阅读次数:
202
思路:空间换时间,hash函数,bitmap,数组标记#include #include bool foo(char* sa, char* sb){ //字符串包含问题,sa中的所有字符是否均在sb中,若是返回true,否则返回false //思路,空间换时间 bool fla...
分类:
其他好文 时间:
2014-07-07 20:42:33
阅读次数:
226
之前用的时候只设置了antialias属性,其实要设置两个flag才行1 paint.setFlags(Paint.ANTI_ALIAS_FLAG|Paint.FILTER_BITMAP_FLAG);2 //或者3 canvas.setDrawFilter(new PaintFlagsD...
分类:
移动开发 时间:
2014-07-07 17:29:48
阅读次数:
346
很多开发者表示,不知道Android的Drawable和Bitmap之间如何相关转换。下面Android123给大家两种比较简单高效的方法。一、Bitmap转DrawableBitmap bm=xxx; //xxx根据你的情况获取BitmapDrawable bd=BitmapDrawable(bm...
分类:
其他好文 时间:
2014-07-07 16:06:03
阅读次数:
183
使用Martix(android.graphics.Matrix)类中的postScale()方法结合Bitmap来实现缩放图片的功能Bitmap bmp = BitmapFactory.decodeResource(getResource(),R.drawalbe.icon1)int bmpwid...
分类:
其他好文 时间:
2014-07-07 16:00:55
阅读次数:
185
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Drawing;namespace BitMap{ /// /// Image 的摘要说明 ...
分类:
其他好文 时间:
2014-07-03 11:07:45
阅读次数:
154
Android可能发生内存泄露的地方总结:1.查询数据库没有关闭游标2.构建adapter时,没有使用缓存的convertView3.Bitmap对象不使用的时候调用recycle()方法释放内存4.释放对象的引用5.单例模式引用context,如果使用actvitiy-context,会造成内存泄...
分类:
移动开发 时间:
2014-07-01 21:27:23
阅读次数:
237
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Drawing;namespace BitMap{ /// /// Image 的摘要说明 ...
分类:
其他好文 时间:
2014-07-01 00:20:26
阅读次数:
219
1.基于消息的通信机制 Intent ---bundle ,extra数据类型有限,比如遇到不可序列化的数据Bitmap,InputStream,或者LinkedList链表等等数据类型就不太好用。2.利用static静态数据,public static成员变量;3.基于外部存储的传输,File/P...
分类:
移动开发 时间:
2014-06-26 17:05:25
阅读次数:
273
BUG 1:GDI+ Image::FromFile 无效
m_pImg = Gdiplus::Bitmap::FromFile(m_imgFilePath);
m_pImg为NULL
原因是没有初始化GDI+。
BUG2:GDI+ new Bitmap不能接受三个参数
//创建目标Bitmap
Bitmap *bmpDest = new Bitmap(destWidth, destHeight, m_pImg->GetPixelFormat());
原因:
//#ifdef _DEBUG
//#...
分类:
其他好文 时间:
2014-06-26 11:59:26
阅读次数:
377