Android realizes image inversion, flip, rotation, zoom in and out

**********************************************************************

Image flipping on Android

**********************************************************************

Then you can put img directly_ A draw to the canvas, canvas.drawbitmap (img_a, 10, P);

Matrix is an important class dealing with image effects such as flipping and scaling. Matrix.postscale can set the scaling scale, which is 1 by default

**********************************************************************Android image rotation

**********************************************************************

**********************************************************************

To achieve the fade in and fade out effect of the picture, you can use: setalpha (alpha); Alpha decreases gradually from 255!

**********************************************************************

There are two key points on how to achieve the scrolling effect of the screen. One is to implement ongesturelistener so that it can be recalled when a touch event occurs. Including pressing, scrolling, etc. according to the API document, it needs to be divided into two steps to detect gesture behavior.

1) Create a gesturedetector instance

2) call the onTouchEvent () method of GestureDetector in the onTouchEvent () method.

Another key point is to implement a simple view to draw pictures.

The code is shown below. Since we do not need to use layout definitions, we do not need to provide XML files. Just setcontentview () in the program.

**********************************************************************

Teach you how to deal with pictures in Google Android platform

**********************************************************************

Manipulate image pixels

Now you can process individual pixels. By using getpixels in the android.graphics.bitmap API, you can load pixels into an integer array.

In this example, you will color each pixel according to certain rules. After this processing, all pixels will be converted into a bytecode ranging from 0 to 255.

Setpixels in android.graphics.bitmap API is used to load this integer array into an image.

The final step is to update the screen through the ImageView variable MIV. The following is a code snippet that implements this dyeing process.

**********************************************************************

Zoom in and out of Android pictures

**********************************************************************

XML file

*********************************************************************

Android image transparency processing code

*********************************************************************

The above is all about Android image processing, including Android image inversion, Android image flip, Android image rotation, image fade in and out effect, Android image zoom in and out, and teaching you to process images on Google Android platform.

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