-1
A
回答
0
我這樣做是使用下面的方法:)
public Bitmap getImageAlbumCover (Bitmap sourceBitmap) {
Bitmap resultBitmap = Bitmap.createBitmap(sourceBitmap, 0, 0,
sourceBitmap.getWidth()-1, sourceBitmap.getHeight()-1);
int padding = 15;
int width = resultBitmap.getWidth();
int height = resultBitmap.getHeight();
Canvas canvas = new Canvas(resultBitmap);
Rect srcRect = new Rect(0, 0, width, height);
Rect desrect1 = new Rect((-1 * 1 * padding), (3 * padding) , width + (-1 * 1 * padding), height + (-1 * 3 * padding));
Rect desrect2 = new Rect((-1 * 2 * padding), (2 * padding) , width + (-1 * 2 * padding), height + (-1 * 2 * padding));
Rect desrect3 = new Rect((-1 * 3 * padding), (1 * padding) , width + (-1 * 3 * padding), height + (-1 * 1 * padding));
Paint paint = new Paint();
paint.setColor(Color.WHITE);
canvas.drawRect(0, 0, width, height, paint);
paint.setAlpha(64);
canvas.drawBitmap(sourceBitmap, srcRect, desrect1, paint);
paint.setAlpha(128);
canvas.drawBitmap(sourceBitmap, srcRect, desrect2, paint);
paint.setAlpha(255);
canvas.drawBitmap(sourceBitmap, srcRect, desrect3, paint);
return resultBitmap;
}
0
您可以使用this library您的問題:
的代碼示例,也許是這樣的:
mageView mImageView;
PhotoViewAttacher mAttacher;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Any implementation of ImageView can be used!
mImageView = (ImageView) findViewById(R.id.iv_photo);
// Set the Drawable displayed
Drawable bitmap = getResources().getDrawable(R.drawable.wallpaper);
mImageView.setImageDrawable(bitmap);
// Attach a PhotoViewAttacher, which takes care of all of the zooming functionality.
mAttacher = new PhotoViewAttacher(mImageView);
}
// If you later call mImageView.setImageDrawable/setImageBitmap/setImageResource/etc then you just need to call
attacher.update();
否則你可以從Android的文檔過渡和動畫閱讀the documentation。甚至有很多例子。
相關問題
- 1. Views.player專輯封面
- 2. 如何獲取專輯封面照片
- 3. 獲取專輯封面照片
- 4. iOS 8專輯封面
- 5. 顯示專輯封面
- 6. 從mp3中提取專輯封面並用Delphi顯示圖片?
- 7. 使用砌體,jQuery和PHP製作專輯封面圖庫
- 8. 發佈照片到Facebook沒有移動專輯封面的訂單專輯
- 9. 提取專輯封面在android系統
- 10. 在線獲取專輯封面
- 11. 安卓:頁面捲曲動畫效果
- 12. 安卓圖庫圖片位置問題
- 13. 拿到專輯封面照片與Facebook ActionScript的API
- 14. 顯示Facebook的專輯封面照片_n代替_s
- 15. 一次加載多張專輯封面照片?
- 16. 如何顯示MP3的專輯封面?
- 17. libspotify API:多張專輯封面?
- 18. 快速專輯封面處理像iTunes?
- 19. 使用facebook api獲取專輯封面
- 20. 沒有編碼的專輯封面
- 21. 獲取專輯封面,如JPEG,PNG等
- 22. 專輯對象下沒有封面
- 23. 作爲通知的專輯封面
- 24. 如何設置/更改專輯封面?
- 25. 添加專輯封面到WMA文件
- 26. 需要安卓IOS的圖像效果庫
- 27. 負載專輯封面到滑翔使用列表視圖
- 28. 在iOS中提取MP3專輯圖片
- 29. 安卓圖片框架
- 30. 安卓圖片下載
謝謝您的回答,但我並不需要動畫,我要作出這樣的拍攝圖像列表的列表視圖,併爲每個圖像它會爲具有不同不透明度值的相同圖像繪製三層視圖。 –