Code example for BitmapRegionDecoder

Methods: getHeight, getWidth

0
        mRegionDecoder = null;
        mLevelCount = 0;
    } 
 
    public synchronized void setRegionDecoder(BitmapRegionDecoder decoder) {
        mRegionDecoder = Utils.checkNotNull(decoder);
        mImageWidth = decoder.getWidth();
        mImageHeight = decoder.getHeight();
        mLevelCount = calculateLevelCount();
    } 
 
    private int calculateLevelCount() { 
        return Math.max(0, Utils.ceilLog2(
                (float) mImageWidth / mScreenNail.getWidth()));
    } 
 
    // Gets a sub image on a rectangle of the current photo. For example, 
    // getTile(1, 50, 50, 100, 3, pool) means to get the region located 
    // at (50, 50) with sample level 1 (ie, down sampled by 2^1) and the 
    // target tile size (after sampling) 100 with border 3. 
    //