Code example for BitmapDrawable

Methods: setBounds, draw

0
    } 
 
    public static Bitmap resizeBitmap(Bitmap bmp,int w,int h) {
        Bitmap result=Bitmap.createBitmap(w,h,Bitmap.Config.RGB_565);
        Canvas canvas=new Canvas(result);
        BitmapDrawable drawable=new BitmapDrawable(bmp);
        drawable.setBounds(0,0,w,h);
        drawable.draw(canvas);
        return result;
    }  
 
    public float[] getEyeDistance(){ 
        return mEyesDistance;
    } 
    public PointF[] getEyePoint(){
        return mEyesMidPts;
    } 
 
    public static final void drawImageToCanvas(Canvas canvas, Drawable mask, 
            FaceCatcher face){
        drawImageToCanvas(canvas, mask, face, 1.f, 1.f);