Skip to content

Most visited

Recently visited

navigation
added in API level 1

android.graphics

Provides low level graphics tools such as canvases, color filters, points, and rectangles that let you handle drawing to the screen directly.

Interfaces

SurfaceTexture.OnFrameAvailableListener Callback interface for being notified that a new stream frame is available. 

Classes

Bitmap  
BitmapFactory Creates Bitmap objects from various sources, including files, streams, and byte-arrays. 
BitmapFactory.Options  
BitmapRegionDecoder BitmapRegionDecoder can be used to decode a rectangle region from an image. 
BitmapShader Shader used to draw a bitmap as a texture. 
BlurMaskFilter This takes a mask, and blurs its edge by the specified radius. 
Camera A camera instance can be used to compute 3D transformations and generate a matrix that can be applied, for instance, on a Canvas
Canvas The Canvas class holds the "draw" calls. 
Color

The Color class provides methods for creating, converting and manipulating colors. 

ColorFilter A color filter can be used with a Paint to modify the color of each pixel drawn with that paint. 
ColorMatrix 4x5 matrix for transforming the color and alpha components of a Bitmap. 
ColorMatrixColorFilter A color filter that transforms colors through a 4x5 color matrix. 
ColorSpace

A ColorSpace is used to identify a specific organization of colors. 

ColorSpace.Connector

A connector transforms colors from a source color space to a destination color space. 

ColorSpace.Rgb

An RGB color space is an additive color space using the RGB color model (a color is therefore represented by a tuple of 3 numbers). 

ColorSpace.Rgb.TransferParameters

Defines the parameters for the ICC parametric curve type 4, as defined in ICC.1:2004-10, section 10.15. 

ComposePathEffect  
ComposeShader A subclass of shader that returns the composition of two other shaders, combined by an Xfermode subclass. 
CornerPathEffect  
DashPathEffect  
DiscretePathEffect  
DrawFilter A DrawFilter subclass can be installed in a Canvas. 
EmbossMaskFilter  
ImageFormat  
Interpolator  
LightingColorFilter A color filter that can be used to simulate simple lighting effects. 
LinearGradient  
MaskFilter MaskFilter is the base class for object that perform transformations on an alpha-channel mask before drawing it. 
Matrix The Matrix class holds a 3x3 matrix for transforming coordinates. 
Movie  
NinePatch The NinePatch class permits drawing a bitmap in nine or more sections. 
Outline Defines a simple shape, used for bounding graphical regions. 
Paint The Paint class holds the style and color information about how to draw geometries, text and bitmaps. 
Paint.FontMetrics Class that describes the various metrics for a font at a given text size. 
Paint.FontMetricsInt Convenience method for callers that want to have FontMetrics values as integers. 
PaintFlagsDrawFilter  
Path The Path class encapsulates compound (multiple contour) geometric paths consisting of straight line segments, quadratic curves, and cubic curves. 
PathDashPathEffect  
PathEffect PathEffect is the base class for objects in the Paint that affect the geometry of a drawing primitive before it is transformed by the canvas' matrix and drawn. 
PathMeasure  
Picture A Picture records drawing calls (via the canvas returned by beginRecording) and can then play them back into Canvas (via draw(Canvas) or drawPicture(Picture)).For most content (e.g. 
PixelFormat  
Point Point holds two integer coordinates  
PointF PointF holds two float coordinates  
PorterDuff

This class contains the list of alpha compositing and blending modes that can be passed to PorterDuffXfermode, a specialized implementation of Paint's transfer mode

PorterDuffColorFilter A color filter that can be used to tint the source pixels using a single color and a specific Porter-Duff composite mode
PorterDuffXfermode

Specialized implementation of Paint's transfer mode

RadialGradient  
Rect Rect holds four integer coordinates for a rectangle. 
RectF RectF holds four float coordinates for a rectangle. 
Region  
RegionIterator  
Shader Shader is the based class for objects that return horizontal spans of colors during drawing. 
SumPathEffect  
SurfaceTexture Captures frames from an image stream as an OpenGL ES texture. 
SweepGradient  
Typeface The Typeface class specifies the typeface and intrinsic style of a font. 
Typeface.Builder A builder class for creating new Typeface instance. 
Xfermode Xfermode is the base class for objects that are called to implement custom "transfer-modes" in the drawing pipeline. 
YuvImage YuvImage contains YUV data and provides a method that compresses a region of the YUV data to a Jpeg. 

Enums

Bitmap.CompressFormat Specifies the known formats a bitmap can be compressed into  
Bitmap.Config Possible bitmap configurations. 
BlurMaskFilter.Blur  
Canvas.EdgeType Constant values used as parameters to quickReject() calls. 
Canvas.VertexMode  
ColorSpace.Adaptation

List of adaptation matrices that can be used for chromatic adaptation using the von Kries transform. 

ColorSpace.Model A color model is required by a ColorSpace to describe the way colors can be represented as tuples of numbers. 
ColorSpace.Named

List of common, named color spaces. 

ColorSpace.RenderIntent

A render intent determines how a connector maps colors from one color space to another. 

Interpolator.Result  
Matrix.ScaleToFit Controlls how the src rect should align into the dst rect for setRectToRect(). 
Paint.Align Align specifies how drawText aligns its text relative to the [x,y] coordinates. 
Paint.Cap The Cap specifies the treatment for the beginning and ending of stroked lines and paths. 
Paint.Join The Join specifies the treatment where lines and curve segments join on a stroked path. 
Paint.Style The Style specifies if the primitive being drawn is filled, stroked, or both (in the same color). 
Path.Direction Specifies how closed shapes (e.g. 
Path.FillType Enum for the ways a path may be filled. 
Path.Op The logical operations that can be performed when combining two paths. 
PathDashPathEffect.Style  
PorterDuff.Mode

Porter-Duff

The name of the parent class is an homage to the work of Thomas Porter and Tom Duff, presented in their seminal 1984 paper titled "Compositing Digital Images". 

Region.Op  
Shader.TileMode  

Exceptions

SurfaceTexture.OutOfResourcesException This class was deprecated in API level 19. No longer thrown. Surface.OutOfResourcesException is used instead.  
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)