Advanced UI/src/com/samples/toolkit/ui/decor/BitmapMask.java
/**
     * Apply a portion of the mask to the destination area. Tile if destination area is smaller than source area
     */
Apply a portion of the mask to the destination area. Tile if destination area is smaller than source area
Apply a portion of the mask to the destination area . Tile if destination area is smaller than source area
private void drawCornerMask( int sourceX, int sourceY, int sourceWidth, int sourceHeight, 
                                 int destX,   int destY,    
                                 Bitmap targetBitmap )
    {
        int sourceOffset = sourceY * _alphaWidth + sourceX;
        int destOffset = 0;
        targetBitmap.getARGB( _cornerARGB, 0, sourceWidth, destX, destY, sourceWidth, sourceHeight );
        for( int y=0; y<sourceHeight; y++ ) {
            for( int x=0; x<sourceWidth; x++, sourceOffset++, destOffset++ ) {
                _cornerARGB[ destOffset] = ( _cornerARGB[ destOffset ] & 0x00ffffff ) | _alphaARGB[ sourceOffset ];
            }
            sourceOffset += _alphaWidth - sourceWidth;
        }
        targetBitmap.setARGB( _cornerARGB, 0, sourceWidth, destX, destY, sourceWidth, sourceHeight );
    }
private void drawCornerMask ( int sourceX , int sourceY , int sourceWidth , int sourceHeight , int destX , int destY , Bitmap targetBitmap ) { int sourceOffset = sourceY * _alphaWidth + sourceX ; int destOffset = 0 ; targetBitmap . getARGB ( _cornerARGB , 0 , sourceWidth , destX , destY , sourceWidth , sourceHeight ) ; for ( int y = 0 ; y < sourceHeight ; y ++ ) { for ( int x = 0 ; x < sourceWidth ; x ++ , sourceOffset ++ , destOffset ++ ) { _cornerARGB [ destOffset ] = ( _cornerARGB [ destOffset ] & 0x00ffffff ) | _alphaARGB [ sourceOffset ] ; } sourceOffset += _alphaWidth - sourceWidth ; } targetBitmap . setARGB ( _cornerARGB , 0 , sourceWidth , destX , destY , sourceWidth , sourceHeight ) ; }
Apply a portion of the mask to the destination area.
Apply a portion of the mask to the destination area .