Java Code Examples for android.graphics.Matrix.setSkew()

The following are Jave code examples for showing how to use setSkew() of the android.graphics.Matrix 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: BBSSDK-for-Android   File: ImageUtils.java   Source Code and License Vote up 5 votes
/**
 * 倾斜图片
 *
 * @param src     源图片
 * @param kx      倾斜因子x
 * @param ky      倾斜因子y
 * @param px      平移因子x
 * @param py      平移因子y
 * @param recycle 是否回收
 * @return 倾斜后的图片
 */
public static Bitmap skew(final Bitmap src, final float kx, final float ky, final float px, final float py, final boolean recycle) {
	if (isEmptyBitmap(src)) {
		return null;
	}
	Matrix matrix = new Matrix();
	matrix.setSkew(kx, ky, px, py);
	Bitmap ret = Bitmap.createBitmap(src, 0, 0, src.getWidth(), src.getHeight(), matrix, true);
	if (recycle && !src.isRecycled()) {
		src.recycle();
	}
	return ret;
}
 
Example 2
Project: LJFramework   File: ImageUtils.java   Source Code and License Vote up 5 votes
/**
 * 倾斜图片
 *
 * @param src 源图片
 * @param kx 倾斜因子x
 * @param ky 倾斜因子y
 * @param px 平移因子x
 * @param py 平移因子y
 * @param recycle 是否回收
 * @return 倾斜后的图片
 */
public static Bitmap skew(Bitmap src, float kx, float ky, float px, float py, boolean recycle) {
    if (isEmptyBitmap(src)) {
        return null;
    }
    Matrix matrix = new Matrix();
    matrix.setSkew(kx, ky, px, py);
    Bitmap ret = Bitmap.createBitmap(src, 0, 0, src.getWidth(), src
            .getHeight(), matrix, true);
    if (recycle && !src.isRecycled()) {
        src.recycle();
    }
    return ret;
}
 
Example 3
Project: buildAPKsSamples   File: AnticiButton.java   Source Code and License Vote up 5 votes
/**
 * Need to invalidate proper area of parent for skewed bounds
 */
private void invalidateSkewedBounds() {
    if (mSkewX != 0) {
        Matrix matrix = new Matrix();
        matrix.setSkew(-mSkewX, 0);
        mTempRect.set(0, 0, getRight(), getBottom());
        matrix.mapRect(mTempRect);
        mTempRect.offset(getLeft() + getTranslationX(), getTop() + getTranslationY());
        ((View) getParent()).invalidate((int) mTempRect.left, (int) mTempRect.top,
                (int) (mTempRect.right +.5f), (int) (mTempRect.bottom + .5f));
    }
}
 
Example 4
Project: GitHub   File: ImageUtils.java   Source Code and License Vote up 3 votes
/**
 * 倾斜图片
 *
 * @param src     源图片
 * @param kx      倾斜因子x
 * @param ky      倾斜因子y
 * @param px      平移因子x
 * @param py      平移因子y
 * @param recycle 是否回收
 * @return 倾斜后的图片
 */
public static Bitmap skew(final Bitmap src, final float kx, final float ky, final float px, final float py, final boolean recycle) {
    if (isEmptyBitmap(src)) return null;
    Matrix matrix = new Matrix();
    matrix.setSkew(kx, ky, px, py);
    Bitmap ret = Bitmap.createBitmap(src, 0, 0, src.getWidth(), src.getHeight(), matrix, true);
    if (recycle && !src.isRecycled()) src.recycle();
    return ret;
}
 
Example 5
Project: Android-UtilCode   File: ImageUtils.java   Source Code and License Vote up 3 votes
/**
 * 倾斜图片
 *
 * @param src     源图片
 * @param kx      倾斜因子x
 * @param ky      倾斜因子y
 * @param px      平移因子x
 * @param py      平移因子y
 * @param recycle 是否回收
 * @return 倾斜后的图片
 */
public static Bitmap skew(Bitmap src, float kx, float ky, float px, float py, boolean recycle) {
    if (isEmptyBitmap(src)) return null;
    Matrix matrix = new Matrix();
    matrix.setSkew(kx, ky, px, py);
    Bitmap ret = Bitmap.createBitmap(src, 0, 0, src.getWidth(), src.getHeight(), matrix, true);
    if (recycle && !src.isRecycled()) src.recycle();
    return ret;
}
 
Example 6
Project: AndroidUtilCode-master   File: ImageUtils.java   Source Code and License Vote up 3 votes
/**
 * 倾斜图片
 *
 * @param src     源图片
 * @param kx      倾斜因子x
 * @param ky      倾斜因子y
 * @param px      平移因子x
 * @param py      平移因子y
 * @param recycle 是否回收
 * @return 倾斜后的图片
 */
public static Bitmap skew(Bitmap src, float kx, float ky, float px, float py, boolean recycle) {
    if (isEmptyBitmap(src)) return null;
    Matrix matrix = new Matrix();
    matrix.setSkew(kx, ky, px, py);
    Bitmap ret = Bitmap.createBitmap(src, 0, 0, src.getWidth(), src.getHeight(), matrix, true);
    if (recycle && !src.isRecycled()) src.recycle();
    return ret;
}
 
Example 7
Project: BaseCore   File: ImageUtils.java   Source Code and License Vote up 3 votes
/**
 * 倾斜图片
 *
 * @param src     源图片
 * @param kx      倾斜因子x
 * @param ky      倾斜因子y
 * @param px      平移因子x
 * @param py      平移因子y
 * @param recycle 是否回收
 * @return 倾斜后的图片
 */
public static Bitmap skew(Bitmap src, float kx, float ky, float px, float py, boolean recycle) {
    if (isEmptyBitmap(src)) return null;
    Matrix matrix = new Matrix();
    matrix.setSkew(kx, ky, px, py);
    Bitmap ret = Bitmap.createBitmap(src, 0, 0, src.getWidth(), src.getHeight(), matrix, true);
    if (recycle && !src.isRecycled()) src.recycle();
    return ret;
}
 
Example 8
Project: HeadlineNews   File: ImageUtils.java   Source Code and License Vote up 3 votes
/**
 * 倾斜图片
 *
 * @param src     源图片
 * @param kx      倾斜因子x
 * @param ky      倾斜因子y
 * @param px      平移因子x
 * @param py      平移因子y
 * @param recycle 是否回收
 * @return 倾斜后的图片
 */
public static Bitmap skew(final Bitmap src, final float kx, final float ky, final float px, final float py, final boolean recycle) {
    if (isEmptyBitmap(src)) return null;
    Matrix matrix = new Matrix();
    matrix.setSkew(kx, ky, px, py);
    Bitmap ret = Bitmap.createBitmap(src, 0, 0, src.getWidth(), src.getHeight(), matrix, true);
    if (recycle && !src.isRecycled()) src.recycle();
    return ret;
}
 
Example 9
Project: RLibrary   File: ImageUtils.java   Source Code and License Vote up 3 votes
/**
 * 倾斜图片
 *
 * @param src     源图片
 * @param kx      倾斜因子x
 * @param ky      倾斜因子y
 * @param px      平移因子x
 * @param py      平移因子y
 * @param recycle 是否回收
 * @return 倾斜后的图片
 */
public static Bitmap skew(Bitmap src, float kx, float ky, float px, float py, boolean recycle) {
    if (isEmptyBitmap(src)) return null;
    Matrix matrix = new Matrix();
    matrix.setSkew(kx, ky, px, py);
    Bitmap ret = Bitmap.createBitmap(src, 0, 0, src.getWidth(), src.getHeight(), matrix, true);
    if (recycle && !src.isRecycled()) src.recycle();
    return ret;
}
 
Example 10
Project: RLibrary   File: ImageUtils.java   Source Code and License Vote up 3 votes
/**
 * 倾斜图片
 *
 * @param src     源图片
 * @param kx      倾斜因子x
 * @param ky      倾斜因子y
 * @param px      平移因子x
 * @param py      平移因子y
 * @param recycle 是否回收
 * @return 倾斜后的图片
 */
public static Bitmap skew(Bitmap src, float kx, float ky, float px, float py, boolean recycle) {
    if (isEmptyBitmap(src)) return null;
    Matrix matrix = new Matrix();
    matrix.setSkew(kx, ky, px, py);
    Bitmap ret = Bitmap.createBitmap(src, 0, 0, src.getWidth(), src.getHeight(), matrix, true);
    if (recycle && !src.isRecycled()) src.recycle();
    return ret;
}