Android implements the bitmap specified area sliding interception function

Suddenly I didn't know what mentality I wanted to do. I searched online for a long time and didn't find a suitable one, so I made one myself.

Effect drawing first:

The transparent area is the area to be intercepted, and other shadow parts are the abandoned area

Image resources are stored in raw. If necessary, you can write and obtain bitmap yourself.

Interface layout:

Screenshotview is a custom view used to display bitmap and slide screenshots. Dot class is used to store the X and Y values of coordinate points.

Mainactivity completes the monitoring of click and slide, and obtains the rectangular position and shape to be drawn by means of coordinate points.

The singleton mode is used to store the intercepted bitmap, which is convenient to call when jumping. You don't need to write your own class. After clicking OK, the bitmap in the area will be extracted and stored in the singleton and called on the next page.

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

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