android BitmapDrawable的使用
来源:互联网 发布:淘宝为什么被删除评价 编辑:程序博客网 时间:2024/05/19 01:08
- //功能:显示缩略图,大小为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();
- //获取第一个图片显示框中的位图
- Bitmap bitmap = 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
- linux中module_param简介
- 如何让SQL语句的执行计划稳定不变-存储概要介绍(转)
- iOS调用WebService
- Android 学习笔记(十六):Widget-进度条
- js iframe自适应高度
- android BitmapDrawable的使用
- 华擎 FM2A75 PRO4刷Bios历险
- Android学习笔记(十八):ListView和RatingBar
- memory 子系统
- Android中View转换为Bitmap等
- Automatic Scripts
- 【面向对象】php新手之学习类与对象-构造函数与析构函数
- fork函数
- BW知识点总结及面试要点