The relationship between Drawable, Bitmap, Canvas, and painting should be known for Android development.

Source: Internet
Author: User

The relationship between Drawable, Bitmap, Canvas, and painting should be known for Android development.

First, let's understand that the display class in the Android platform is View, but it also provides the underlying graphics class android. graphics. What we call today is the underlying graphic interface of graphics.

Bitmap is called a Bitmap. Generally, the format of a Bitmap file is suffixed with bmp. Of course, there are many encoders such as RGB565 and RGB888. As a pixel-by-pixel Display object, the execution efficiency is high, but the disadvantage is also obvious low storage efficiency. It is better to understand it as a storage object.

Drawable-as a common image object in Android, it can load images in common formats, such as GIF, PNG, and JPG. Of course, it also supports BMP. Of course, it also provides some advanced visualization objects, such as gradient and graphics.

Canvas-the name of the Canvas can be seen as a processing process. You can use various methods to manage Bitmap, GL, or Path paths, at the same time, it can work with the Matrix class to perform image rotation, scaling, and other operations, while the Canvas class also provides operations such as cropping and selecting.

Paint-we can regard it as a drawing tool, such as a Paint brush or Paint brush. He manages the fonts, colors, and styles of each drawing tool.

If Android game development and display effects are involved, you can use these underlying graphics classes to efficiently implement your own applications.

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.