gpt4 book ai didi

java - 用 Picasso 叠加图像

转载 作者:太空狗 更新时间:2023-10-29 15:25:30 24 4
gpt4 key购买 nike

我有一张主产品图片,它始终显示在我的 ImageView 中。现在可能有几个叠加层(与原始图像大小相同,但有很多透明区域)。

所有这些图像都来自远程 URL。例如:

Main image

Overlay

是否可以将它们全部加载到一个 ImageView 中?

最佳答案

您可以使用自定义 ImageViewload bitmaps with Picasso然后在 Canvas 上绘制这些位图:

@Override
protected void onDraw(final Canvas canvas) {
super.onDraw(canvas);

canvas.drawBitmap(bitmap1, 0, 0, null); // lower image
canvas.drawBitmap(bitmap2, 0, 0, null); // upper image
}

关于java - 用 Picasso 叠加图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43541384/

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