---
title: "Android Bitmap 与 Drawable之间的转换"
author: "fonter"
date: "2010-05-19T15:07:02Z"
tags: []
categories: ["移动开发"]
slug: "android-bitmap-drawable"
draft: false
lastmod: "2010-07-28T09:42:03Z"
id: 669881
url: "https://fonter.iteye.com/blog/669881"
---

转换Bitmap to Drawable

 

```
BitmapDrawable bitmapDrawable = (BitmapDrawable)bitmap;   
Drawable drawable = (Drawable)bitmapDrawable;   
  
  
Bitmap bitmap = new Bitmap (...);   
Drawable drawable = new BitmapDrawable(bitmap);
```

 

 

转换Drawable to Bitmap

 

```
Drawable d = ImagesList.get(0);
Bitmap bitmap = ((BitmapDrawable)d).getBitmap();
```