Distort an image with Drawbitmapmesh

Source: Internet
Author: User

Canvas provides a drawbitmapmesh (bitmap, Meshwidth, Meshheight, Verts, Vertoffset, colors, Coloroffset, paint) method, This method can distort the bitmap, and realize various twisting effects such as "rippling" and "wind-blown banner".

Key parameter description of the Drawbitmapmesh method:

Bitmap: Specifies the source bitmap that needs to be distorted.

Meshwidth: This parameter controls how many grids the source bitmap is divided across horizontally.

Meshheight: This parameter controls how many grids the source bitmap is divided vertically.

Verts: This parameter is an array of length (meshwidth+1) * (meshheight+1) * *, which records the distorted bitmap "vertex" position, although it is a single in the array, it actually records the data is shaped like (x0,y0), (X1,y), (x2,y )...... (XN,YN) formatted data that controls the distortion effect on the bitmap bitmap.

Vertoffset: Controls the Verts array to distort the bitmap (ignoring the distorted effect of the data before Vertoffset) from the first array elements.

Distort an image with Drawbitmapmesh

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.