-1
在某些情况下,我必须在另一个顶部添加一个位图。但我的代码不起作用。当然,我真的认为,我没有做正确的事情,但我不知道如何去做这件事。android绘制位图高于另一个
之后,我必须将我的位图转换为图片对象,然后将我的图片对象添加到我的MarkerOption对象。
这里我的代码:
Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.lifr);
Bitmap bmp2 = BitmapFactory.decodeResource(getResources(), R.drawable.manche_a_air);
Bitmap bmOverlay = Bitmap.createBitmap(bmp.getWidth(), bmp.getHeight(), bmp.getConfig());
Canvas canvas = new Canvas(bmOverlay);
canvas.drawBitmap(bmp, 0.0f, 0.0f, null);
canvas.drawBitmap(bmp2, bmp.getWidth(), bmp.getHeight()/2, null);
markerOptions.icon(BitmapDescriptorFactory.fromBitmap(bmOverlay));
return markerOptions;
如果任何人有一个想法?先谢谢你。
为什么不使用BitmapDescriptorFactory.fromBitmap(bmOverlay)? – pskink 2014-09-05 11:37:02