android BitmapDrawable的使用
来源:互联网 发布:中国动员能力知乎 编辑:程序博客网 时间:2024/05/19 00:09
- //功能:显示缩略图,大小为40*40
- //通过openRawResource获取一个inputStream对象
- InputStream inputStream = getResources().openRawResource(R.drawable.test);
- //通过一个InputStream创建一个BitmapDrawable对象
- BitmapDrawable drawable = new BitmapDrawable(inputStream);
- //通过BitmapDrawable对象获得Bitmap对象
- Bitmap bitmap = drawable.getBitmap();
- //利用Bitmap对象创建缩略图
- bitmap = ThumbnailUtils.extractThumbnail(bitmap, 40, 40);
- //imageView 显示缩略图的ImageView
- imageView.setImageBitmap(bitmap);
- //功能:image2从image1中截取120*120大小后显示,截取起始坐标为(x,y)
- BitmapDrawable bitmapDrawable = (BitmapDrawable) image1.getDrawable();
- //获取第一个图片显示框中的位图
- Bitmapbitmap = bitmapDrawable.getBitmap();
- //显示图片的指定区域
- image2.setImageBitmap(Bitmap.createBitmap(bitmap, x, y, 120, 120));
- image2.setAlpha(alpha);
- android BitmapDrawable的使用
- android BitmapDrawable的使用
- android BitmapDrawable的使用
- android BitmapDrawable的使用
- android BitmapDrawable的使用
- Android BitmapDrawable()的使用
- Android BitmapDrawable()的使用
- Android BitmapDrawable使用场景
- android bitmapdrawable基本使用
- bitmapdrawable的使用
- Android的Drawable之BitmapDrawable
- Android中BitmapDrawable的一个bug
- Android Bitmap 和 BitmapDrawable的区别
- BitmapDrawable和Bitmap.XML的使用
- Bitmap,BitmapDrawable,BitmapFactory的简单使用,以及AssetManager的使用
- Android-drawable资源-BitmapDrawable
- android--BitmapDrawable之BitmapShader
- 6.1 Android Framework - BitmapDrawable
- 将你的网站从MySQL改为PostgreSQL
- 2013-09-01
- JAVA的String 类【转】
- 竖线与正则表达式
- iphone开发中数据持久化之——模型对象归档(二)
- android BitmapDrawable的使用
- 在Quick-cocos2dx中使用云风pbc解析Protocol Buffers,支持win、mac、ios、android
- 应用程序正常初始化失败"-0xc0150002 解决办法
- WINDOWS下创建ASM实例过程详细图解
- Spring dataSource配置
- android中的对话框之四:各种系统对话框的使用实例
- 我的PGA我作主----搞清楚什么是真正的PGA
- 透过表象看本质!?之二——除了最小p乘,还有PCA
- 你不可以不知道的findViewById