IT. Expert System.

Android Reference

NinePatch


android.graphics

Class NinePatch



  • public class NinePatch
    extends Object
    The NinePatch class permits drawing a bitmap in nine sections. The four corners are unscaled; the four edges are scaled in one axis, and the middle is scaled in both axes. Normally, the middle is transparent so that the patch can provide a selection about a rectangle. Essentially, it allows the creation of custom graphics that will scale the way that you define, when content added within the image exceeds the normal bounds of the graphic. For a thorough explanation of a NinePatch image, read the discussion in the 2D Graphics document.

    The Draw 9-Patch tool offers an extremely handy way to create your NinePatch images, using a WYSIWYG graphics editor.

    • Constructor Detail

      • NinePatch

        public NinePatch(Bitmap bitmap,
                 byte[] chunk,
                 String srcName)
        Create a drawable projection from a bitmap to nine patches.
        Parameters:
        bitmap - The bitmap describing the patches.
        chunk - The 9-patch data chunk describing how the underlying bitmap is split apart and drawn.
        srcName - The name of the source for the bitmap. Might be null.
      • NinePatch

        public NinePatch(NinePatch patch)
    • Method Detail

      • setPaint

        public void setPaint(Paint p)
      • draw

        public void draw(Canvas canvas,
                RectF location)
        Draw a bitmap of nine patches.
        Parameters:
        canvas - A container for the current matrix and clip used to draw the bitmap.
        location - Where to draw the bitmap.
      • draw

        public void draw(Canvas canvas,
                Rect location)
        Draw a bitmap of nine patches.
        Parameters:
        canvas - A container for the current matrix and clip used to draw the bitmap.
        location - Where to draw the bitmap.
      • draw

        public void draw(Canvas canvas,
                Rect location,
                Paint paint)
        Draw a bitmap of nine patches.
        Parameters:
        canvas - A container for the current matrix and clip used to draw the bitmap.
        location - Where to draw the bitmap.
        paint - The Paint to draw through.
      • getDensity

        public int getDensity()
        Return the underlying bitmap's density, as per Bitmap.getDensity().
      • getWidth

        public int getWidth()
      • getHeight

        public int getHeight()
      • hasAlpha

        public final boolean hasAlpha()
      • getTransparentRegion

        public final Region getTransparentRegion(Rect location)
      • isNinePatchChunk

        public static boolean isNinePatchChunk(byte[] chunk)


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 253 / 158674506. Delta: 0.03085 с