首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

图片下加另外一个图标

2012-09-22 
图片上加另外一个图标如题,关键代码如下:?@Overrideprotected void onCreate(Bundle savedInstanceState)?

图片上加另外一个图标

如题,关键代码如下:

?

@Override

protected void onCreate(Bundle savedInstanceState)?

{

super.onCreate(savedInstanceState);

setContentView(R.layout.bitmap_change);

iView = (ImageView)findViewById(R.id.iv);

originBg = BitmapFactory.decodeResource(this.getResources(), R.drawable.download_completed);

labelBitmap = BitmapFactory.decodeResource(this.getResources(), R.drawable.icon);

int widthOrg = originBg.getWidth();

int heightOrg = originBg.getHeight();

resultBitmap = Bitmap.createBitmap(widthOrg,heightOrg,Config.ARGB_8888);

?

Canvas canvasIn = new Canvas(resultBitmap);

canvasIn.drawBitmap(originBg,0,0,null);

canvasIn.drawBitmap(labelBitmap,10,10,null);

canvasIn.save();

iView.setImageBitmap(resultBitmap);

//newMap = Bitmap.createBitmap(bitmap, 0, 0, widthOrg, heightOrg, matrix,true);

?

}

private Bitmap zoomBitmap(float scale)

{

Matrix m = new Matrix();

m.postScale(scale, scale);

resultBitmap = Bitmap.createBitmap(resultBitmap, 0, 0, resultBitmap.getWidth(), resultBitmap.getHeight(), m, true);

return resultBitmap;

}

热点排行