Implementation method of adding watermark to Android pictures

Implementation method of adding watermark to Android pictures

Implementation effect diagram:

The watermark (text and picture) on the mobile phone uses some methods of bitmap, matrix and canvas, which can realize the effects of stretching, rotation, displacement, etc. the principle is very simple, that is, draw graphics, pictures, text, etc. on the canvas to get the effect picture you want.

Baidu search image watermarking has many results, but we can't find the code of oblique watermarking. Many companies require the effect shown in the figure above, so they write to play.

Using 44kb PNG images to verify efficiency:

Xiaomi 4 mobile phone output: D / brycegao: watermark time: 69 milliseconds

Use 3M byte JPG pictures to test watermark and report oom error.

When the mobile terminal uses the Android native method to make watermark, it should first compress the resolution to avoid oom, but affect the clarity; Most apps send the original image to the server and watermark it in the background.

Because the native method has resolution and memory limitations, I heard that qiniu's picture library (supporting watermark) is very easy to use. Let's see if it can be landed in Android phones with various configurations.

The above is a detailed explanation of the method of adding watermark to Android. There are many articles on Android Development on this site. Welcome to search and consult. Thank you for reading. I hope it can help you. Thank you for your support to this site!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>