Android Advanced Canvas Drawing

Source: Internet
Author: User

Canvas is a very useful concept in graphic programming. There are usually 3 basic components:

1.Canvas provides a drawing method to draw basic graphics to the underlying bitmap. (I think it's a good explanation, much better than explaining it as a canvas)

2.Paint is called a brush or brush, paint can specify how to draw a basic shape onto a bitmap.

The surface of the 3.Bitmap drawing.

The Android drawing API supports transparency, gradient fills, rounded rectangles, and anti-aliasing.

1. Content that can be drawn

The Canvase class encapsulates a bitmap used as a drawing surface, and it also provides a draw* method to implement the design.

2. Maximum use of paint

Pain is the equivalent of a brush and palette. It can choose how to render the basic graphics drawn on the canvas using the Draw method described above. By modifying the Paint object, you can control color, style, font, and special effects while drawing.

Note that some of the paint options described here are not available when hardware acceleration is used to improve the drawing performance of 2D graphics. Therefore, it is important to check how hardware acceleration affects the drawing of 2D graphics.

The Android SDK contains some very good examples of most of the features available in the Paint class. You can find them in the graphics subfolder of the API Demo tutorial:

SDK \ samples\android-x \apidemos \ src\ com\example\android\apis\graphics


Related Article

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.