Draw bitmaps from resources over another

Deadly 提交于 2019-12-01 04:47:22

Try this:

canvas.drawBitmap(backgroundImageBitmap, 0.0f, 0.0f, null);
canvas.drawBitmap(foregroundImageBitmap, 0.0f, 0.0f, null);

The second image (foreground image) has to have Alpha aspects or you can't see through it.

If you use an ImageView you can set the first bitmap as a background and the second as an image source.

<ImageView 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/background"
    android:src="@drawable/foreground"/>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!