Java Code Examples for

The following are Jave code examples for showing how to use setConcat() of the class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: CSipSimple   File:   Source Code and License Vote up 5 votes
private void updateScale() {
    Drawable d = getDrawable();
    if(d instanceof BitmapDrawable) {
        BitmapDrawable bd = (BitmapDrawable) d;

        // Don't upscale if more than 2x larger
        if (getWidth() > mMaxScale * bd.getIntrinsicWidth()
                && getHeight() > mMaxScale * bd.getIntrinsicHeight()) {
            Matrix trans = new Matrix();
            Matrix scale = new Matrix();
            trans.setTranslate((getWidth() - mMaxScale * bd.getIntrinsicWidth())/2, (getHeight() - mMaxScale * bd.getIntrinsicHeight())/2);
            scale.setScale(mMaxScale, mMaxScale);
            Matrix m = new Matrix();
            if(isInEditMode()) {
                // WTF? Edit mode consider inversed matrix??
                m.setConcat(scale, trans);
            }else {
                m.setConcat(trans, scale);
        }else {