PaintFlags Enum
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Enumerates values returned by several types and taken as a parameter of several types.
This enumeration supports a bitwise combination of its member values.
[System.Flags]
public enum PaintFlags
[<System.Flags>]
type PaintFlags =
- Inheritance
-
PaintFlags
- Attributes
Fields
| Name | Value | Description |
|---|---|---|
| AntiAlias | 1 | Paint flag that enables antialiasing when drawing. Enabling this flag will cause all draw operations that support antialiasing to use it. Android reference for Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. |
| FilterBitmap | 2 | Paint flag that enables bilinear sampling on scaled bitmaps. If cleared, scaled bitmaps will be drawn with nearest neighbor sampling, likely resulting in artifacts. This should generally be on when drawing bitmaps, unless performance-bound (rendering to software canvas) or preferring pixelation artifacts to blurriness when scaling significantly. If bitmaps are scaled for device density at creation time (as resource bitmaps often are) the filtering will already have been done. On devices running Build.VERSION_CODES.O and below, hardware accelerated drawing always uses bilinear sampling on scaled bitmaps, regardless of this flag. On devices running Build.VERSION_CODES.Q and above, this flag defaults to being set on a new Paint. It can be cleared with setFlags(int) or setFilterBitmap(boolean). Android reference for Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. |
| Dither | 4 | Paint flag that enables dithering when blitting. Enabling this flag applies a dither to any blit operation where the target's colour space is more constrained than the source. Android reference for Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. |
| UnderlineText | 8 | Paint flag that applies an underline decoration to drawn text. Android reference for Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. |
| StrikeThruText | 16 | Paint flag that applies a strike-through decoration to drawn text. Android reference for Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. |
| FakeBoldText | 32 | Paint flag that applies a synthetic bolding effect to drawn text. Enabling this flag will cause text draw operations to apply a simulated bold effect when drawing a Typeface that is not already bold. Android reference for Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. |
| LinearText | 64 | Paint flag that enables smooth linear scaling of text. Enabling this flag does not actually scale text, but rather adjusts text draw operations to deal gracefully with smooth adjustment of scale. When this flag is enabled, font hinting is disabled to prevent shape deformation between scale factors, and glyph caching is disabled due to the large number of glyph images that will be generated. SUBPIXEL_TEXT_FLAG should be used in conjunction with this flag to prevent glyph positions from snapping to whole pixel values as scale factor is adjusted. Android reference for Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. |
| SubpixelText | 128 | Paint flag that enables subpixel positioning of text. Enabling this flag causes glyph advances to be computed with subpixel accuracy. This can be used with LINEAR_TEXT_FLAG to prevent text from jittering during smooth scale transitions. Android reference for Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. |
| DevKernText | 256 | Legacy Paint flag, no longer used. Android reference for Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. |
| EmbeddedBitmapText | 1024 | Paint flag that enables the use of bitmap fonts when drawing text. Disabling this flag will prevent text draw operations from using embedded bitmap strikes in fonts, causing fonts with both scalable outlines and bitmap strikes to draw only the scalable outlines, and fonts with only bitmap strikes to not draw at all. Android reference for Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. |
| VerticalText | 4096 | A flag that controls text to be written in vertical orientation This flag is used for telling the underlying text layout engine that the text is for vertical direction. By enabling this flag, text measurement, drawing and shaping APIs works for vertical text layout. For example, Canvas.drawText(String,float,float,Paint) draws text from top to bottom. Paint.measureText(String) returns vertical advances instead of horizontal advances. TextRunShaper shapes text vertically and report glyph IDs for vertical layout. Do not set this flag for making Layout. The Layout class and its subclasses are designed for horizontal text only and does not work for vertical text. Android reference for Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. |
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.