Android programming supports dragging to change the position of the picture superimposed text function example

This article describes an example of Android programming to realize the function of superimposing text in pictures that support dragging to change position. Share with you for your reference, as follows:

The reason for this demo is that there is a wonderful demand in the recent project: after taking photos, users add notes while sharing them with wechat, and want to obtain the contents entered by users in the wechat pop-up box and save them on their own server. In fact, the content program is not available, so a compromise is adopted to write the text directly on the picture.

First, the demo rendering:

Function:

1. The user can input the content freely, and can wrap the line manually, and the line will wrap automatically when the line is full. 2. Drag to change the position of the text in the picture (the text will not exceed the picture area). 3. Click the "generate picture" button to generate a picture file with text.

There are not many codes, which are directly pasted:

Activity:

A tool class:

Layout file:

More readers interested in Android related content can view the special topics of this site: summary of Android graphics and image processing skills, introduction and advanced tutorial of Android development, summary of Android debugging skills and common problem solving methods, summary of Android basic component usage, summary of Android view skills, summary of Android layout skills, and Android control usage summary

I hope this article will help you in Android programming.

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
分享
二维码
< <上一篇
下一篇>>