Some notes on how to use paint in Android

Source: Internet
Author: User

Paint is an important class for drawing text and graphics in the Android API, which is located in the Android.graphics package, which appears early in the class. The use of paint,paint similar to JavaScript is also inseparable from canvas.

Paint is not really a "brush", the actual "painting" is the bottom layer, the graphics package under the paint is not visible, the paint encapsulates the various parameters of the painting.

Initializes the paint, which can be passed directly through the default constructor

Paint Mpaint = new paint ();

  • Settextsize (): If you want to draw text, you generally need to set the font size, or the default drawing 12px, the method determines the width of two lowercase ' x ' letters.
  • SetColor (int color): Pass in a hexadecimal color parameter to set the color of the ARGB
  • Setantalias (Boolean): Set whether anti-aliasing

Some notes on how to use paint in Android

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.