/*************************************** **************************************** ************** Author: conowen @ Dazhong* E-mail: conowen@hotmail.com* Http://blog.csdn.net/conowen* Note: This article is original and only used for learning and
Today, Bitmap is used many times. Bitmap is simply a Bitmap. You need to obtain image resources for some image processing operations.1. Related Concepts
1. Drawable is a printable object. It may be a BitmapDrawable, A ShapeDrawable, or LayerDrawable
Common bitmap Processing Methods in Android
A lot of bitmap-related processing methods have been collected, and almost all of them are applied to projects!
Package com. tmacsky. utils; import java. io. byteArrayOutputStream; import java. io.
Bitmap is the most commonly used resource in our development. After all, a beautiful interface is the most attractive to users.1. Retrieve bitmap from resource
Bitmapdrawable or bitmapfactory can be used to obtain bitmaps in resources.
Of course,
Bitmap related1. Bitmap is more special because it can not be created and can only be aided by the bitmapfactory and according to the source of the image may be divided into the following situations:* PNG images such as: R.drawable.tianjinJava
Bitmaps are the most commonly used resource in our development, after all, a beautiful interface is the most attractive to the user.1. Getting a bitmap from a resourceYou can use bitmapdrawable or bitmapfactory to get a bitmap from a resource.Of
Basic operations of drawable and Bitmap, drawablebitmap
1. drawable graphical objects. Images in common formats can be reprinted, which may be Bitmapdrawable, shapedrawable, or GIF, PNG, or JEPG.
2. Bitmap is a Bitmap for image processing.
3. Canvas
Drawable and Bitmap conversion, drawablebitmap1. Bitmap to DrawableBitmap bm = xxx; // xxx is obtained based on your situationBitmapDrawable bd = new BitmapDrawable (bm );Because BtimapDrawable is a subclass of Drawable, you can directly use the bd
1. How to Create a bitmapdrawable object
Bitmap represents a bitmap image. Android supports bitmap images in three formats:. PNG (preferred}.jpg (acceptable) and. GIF (discouraged ).
The secondary node has the worst support.
You can directly use the
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.