Advanced UI/src/com/samples/toolkit/ui/component/SliderField.java
/**
     * Cuts up the background image and margins you provide
     * to make the left, center, and right bitmaps
     */
Cuts up the background image and margins you provide
to make the left, center, and right bitmaps
Cuts up the background image and margins you provide to make the left center and right bitmaps
public void initBitmaps( Bitmap thumb, Bitmap progress, Bitmap base, int state )
    {
        if( progress.getWidth() <= _leftCapWidth
         || base.getWidth() <= _rightCapWidth ) {
            throw new IllegalArgumentException();
        }
         if( thumb.hasAlpha() || progress.hasAlpha() || base.hasAlpha() ) {
             _rop = Graphics.ROP_SRC_ALPHA;
         }
        _thumb[ state ] = thumb;
        _progress[ state ] = progress;
        _base[ state ] = base;
        int[] argbCopyBuffer;
        int progressTileWidth = progress.getWidth() - _leftCapWidth;
        int progressTileHeight = progress.getHeight();
        Bitmap progressTile = new Bitmap( progressTileWidth, progressTileHeight );
        argbCopyBuffer = new int[ progressTileWidth * progressTileHeight ];
        progress.getARGB( argbCopyBuffer, 0, progressTileWidth, _leftCapWidth, 0, progressTileWidth, progressTileHeight );
        progressTile.setARGB( argbCopyBuffer, 0, progressTileWidth, 0, 0, progressTileWidth, progressTileHeight );
        int baseTileWidth = base.getWidth() - _rightCapWidth;
        int baseTileHeight = base.getHeight();
        Bitmap baseTile = new Bitmap( baseTileWidth, baseTileHeight );
        argbCopyBuffer = new int[ baseTileWidth * baseTileHeight ];
        base.getARGB( argbCopyBuffer, 0, baseTileWidth, 0, 0, baseTileWidth, baseTileHeight );
        baseTile.setARGB( argbCopyBuffer, 0, baseTileWidth, 0, 0, baseTileWidth, baseTileHeight );
        _progressTile[ state ] = progressTile;
        _baseTile[ state ] = baseTile;
    }
public void initBitmaps ( Bitmap thumb , Bitmap progress , Bitmap base , int state ) { if ( progress . getWidth ( ) <= _leftCapWidth || base . getWidth ( ) <= _rightCapWidth ) { throw new IllegalArgumentException ( ) ; } if ( thumb . hasAlpha ( ) || progress . hasAlpha ( ) || base . hasAlpha ( ) ) { _rop = Graphics . ROP_SRC_ALPHA ; } _thumb [ state ] = thumb ; _progress [ state ] = progress ; _base [ state ] = base ; int [ ] argbCopyBuffer ; int progressTileWidth = progress . getWidth ( ) - _leftCapWidth ; int progressTileHeight = progress . getHeight ( ) ; Bitmap progressTile = new Bitmap ( progressTileWidth , progressTileHeight ) ; argbCopyBuffer = new int [ progressTileWidth * progressTileHeight ] ; progress . getARGB ( argbCopyBuffer , 0 , progressTileWidth , _leftCapWidth , 0 , progressTileWidth , progressTileHeight ) ; progressTile . setARGB ( argbCopyBuffer , 0 , progressTileWidth , 0 , 0 , progressTileWidth , progressTileHeight ) ; int baseTileWidth = base . getWidth ( ) - _rightCapWidth ; int baseTileHeight = base . getHeight ( ) ; Bitmap baseTile = new Bitmap ( baseTileWidth , baseTileHeight ) ; argbCopyBuffer = new int [ baseTileWidth * baseTileHeight ] ; base . getARGB ( argbCopyBuffer , 0 , baseTileWidth , 0 , 0 , baseTileWidth , baseTileHeight ) ; baseTile . setARGB ( argbCopyBuffer , 0 , baseTileWidth , 0 , 0 , baseTileWidth , baseTileHeight ) ; _progressTile [ state ] = progressTile ; _baseTile [ state ] = baseTile ; }
Cuts up the background image and margins you provide
 to make the left, center, and right bitmaps
Cuts up the background image and margins you provide to make the left center and right bitmaps
// If any one of our images has an alpha channel we need to use ROP_SRC_ALPHA instead of ROP_SRC_COPY
 // Create the progress tile (i.e. to the left of the thumb)
 // Create the base tile (i.e. to the right of the thumb)
