如何在android中将小图像绘制到画布中

时间:2021-11-27 21:18:32

I would like to ask on how to draw a small png file into the screen.

我想询问如何在屏幕上绘制一个小的png文件。

First I created an xml that shows the background picture. now I wanted to place a small picture inside that xml using bitmap.

首先,我创建了一个显示背景图片的xml。现在我想使用位图在xml中放置一个小图片。

Is it possible? and how, sorry I am just new to android development.

可能吗?以及如何,对不起我刚刚开始android开发。

1 个解决方案

#1


0  

ImageView i=new ImageView(yourActivityClassName.this);

ImageView i = new ImageView(yourActivityClassName.this);

YourParentLayout.addView(i);

i.setImageBitmap(bm);

#1


0  

ImageView i=new ImageView(yourActivityClassName.this);

ImageView i = new ImageView(yourActivityClassName.this);

YourParentLayout.addView(i);

i.setImageBitmap(bm);