通过图片url生成Bitmap对象和Drawable对象
来源:互联网 发布:wms钢铁加工软件 编辑:程序博客网 时间:2024/06/04 18:06
/**
* @param urlpath
* @return Bitmap
* 根据图片url获取图片对象
*/
public static Bitmap getBitMBitmap(String urlpath) {
Bitmap map = null;
try {
URL url = new URL(urlpath);
URLConnection conn = url.openConnection();
conn.connect();
InputStream in;
in = conn.getInputStream();
map = BitmapFactory.decodeStream(in);
// TODO Auto-generated catch block
} catch (IOException e) {
e.printStackTrace();
}
return map;
}
/**
* @param urlpath
* @return Bitmap
* 根据url获取布局背景的对象
*/
public static Drawable getDrawable(String urlpath){
Drawable d = null;
try {
URL url = new URL(urlpath);
URLConnection conn = url.openConnection();
conn.connect();
InputStream in;
in = conn.getInputStream();
d = Drawable.createFromStream(in, "background.jpg");
// TODO Auto-generated catch block
} catch (IOException e) {
e.printStackTrace();
}
return d;
}
* @param urlpath
* @return Bitmap
* 根据图片url获取图片对象
*/
public static Bitmap getBitMBitmap(String urlpath) {
Bitmap map = null;
try {
URL url = new URL(urlpath);
URLConnection conn = url.openConnection();
conn.connect();
InputStream in;
in = conn.getInputStream();
map = BitmapFactory.decodeStream(in);
// TODO Auto-generated catch block
} catch (IOException e) {
e.printStackTrace();
}
return map;
}
/**
* @param urlpath
* @return Bitmap
* 根据url获取布局背景的对象
*/
public static Drawable getDrawable(String urlpath){
Drawable d = null;
try {
URL url = new URL(urlpath);
URLConnection conn = url.openConnection();
conn.connect();
InputStream in;
in = conn.getInputStream();
d = Drawable.createFromStream(in, "background.jpg");
// TODO Auto-generated catch block
} catch (IOException e) {
e.printStackTrace();
}
return d;
}
0 0
- 通过图片url生成Bitmap对象和Drawable对象
- 通过图片url生成Bitmap对象和Drawable对象
- 通过图片url,得到Bitmap对象
- 通过图片的url获取Bitmap对象,给Imageview使用
- drawable转为bitmap对象
- 通过图片id R.drawable.xx 的到Drawable 对象
- 通过纯RGB数据流生成Bitmap对象
- 在drawable文件中的图片获取bitmap对象
- SimpleAdapter中使用Drawable和Bitmap对象的方法
- SimpleAdapter中使用Drawable和Bitmap对象的方法
- SimpleAdapter中使用Drawable和Bitmap对象的方法
- SimpleAdapter中使用Drawable和Bitmap对象的方法
- 通过一个网络url地址获取一个bitmap对象
- Android 根据网络图片URL转Bitmap对象
- Android 根据网络图片URL转Bitmap对象
- **ANDROID**# 第七章图形与图像处理(静态处理) > Bitmap是有像素点构成的点阵图。 ------ ## 使用简单的图片 ---- * 通过Drawable对象进行访问。
- 根据url获取Bitmap对象
- 绘制bitmap图片保存,生成ico文件或者对象
- android之service简述
- JS判断客户端操作系统(具体到版本和型号)
- Linux Shell 通配符、元字符、转义符使用实例介绍
- 如何让Tornado来帮你做交叉编译
- hibernate uniqueResult方法
- 通过图片url生成Bitmap对象和Drawable对象
- poj 2046 Power Strings KMP
- 在Windows Azure虚拟主机上宿主Byteart Retail案例程序
- poj1088 滑雪 DP+DFS
- 金相抛光机既可以美容汽车也可以将汽车毁容
- tomcat7域名绑定问题
- centos linux 版本下 安装apche php mysql 环境
- Android常用权限获取和设置
- Eclipse代码自动补全设置