gpt4 book ai didi

android - 如何在动态位置上动态显示图像

转载 作者:行者123 更新时间:2023-11-29 22:32:08 25 4
gpt4 key购买 nike

我有矩形和图像,我想在矩形所在的位置上显示图像……它都是动态的。我正在使用位图类来显示,但现在我必须根据该矩形设置位置...

请帮忙。非常感谢。

最佳答案

经过多次谷歌搜索后,我终于得到了结果,所以我想与其他人分享。覆盖 onDraw() 方法并将此代码放入其中:

Paint paint = new Paint();
this.setbMap(BitmapFactory.decodeByteArray(imageTile, 0, imageTile.length));

Bitmap adapt = Bitmap.createBitmap(bMap);
canvas.drawBitmap(adapt, rect.left, rect.top, paint);

关于android - 如何在动态位置上动态显示图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3626740/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com