如何在我的Android应用程序中为每个活动添加水印? [英] How do I add a watermark to each activity in my android app ?

查看:228
本文介绍了如何在我的Android应用程序中为每个活动添加水印?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道要将图片添加到任何活动中。但有没有可能在每个屏幕/活动中添加我的徽标水印?



我尝试过的方法:



I know to add image to any activity. But is there any possibility to add a Watermark of my logo to each screen/activity ?

What I have tried:

<ImageView

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:src="@drawable/silver"

        android:layout_marginTop="120dp"

        />





我可以在我的活动中插入图片但是可以在所有活动的背景下将此图像设为我的Watermark徽标?



I could insert an Image to my activity but is it possible to make this image my Watermark logo at the background of all activity ?

推荐答案

你eed创建一个canvas对象,然后在其上绘制。画布的大小与屏幕大小相同,因此您可以测量水印位图的大小。然后将其渲染为活动中的背景图像。



如何在Android中为图像添加水印效果? - 堆栈溢出 [ ^ ]
You need to create a canvas object then draw on top of that. Canvas would be of size of the screen and so you can then measure the size for watermark bitmap. Then render it as a background image in the activity.

How might I add a watermark effect to an image in Android? - Stack Overflow[^]


这篇关于如何在我的Android应用程序中为每个活动添加水印?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆