當前位置: 首頁>>代碼示例>>Java>>正文


Java ColorMatrix.setConcat方法代碼示例

本文整理匯總了Java中android.graphics.ColorMatrix.setConcat方法的典型用法代碼示例。如果您正苦於以下問題:Java ColorMatrix.setConcat方法的具體用法?Java ColorMatrix.setConcat怎麽用?Java ColorMatrix.setConcat使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.graphics.ColorMatrix的用法示例。


在下文中一共展示了ColorMatrix.setConcat方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCreate

import android.graphics.ColorMatrix; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_fold);

    mImageView = (ImageView)findViewById(R.id.image_view);
    mImageView.setPadding(ANTIALIAS_PADDING, ANTIALIAS_PADDING, ANTIALIAS_PADDING,
            ANTIALIAS_PADDING);
    mImageView.setScaleType(ImageView.ScaleType.FIT_XY);
    mImageView.setImageDrawable(getResources().getDrawable(R.drawable.image));

    mTextureView = new TextureView(this);
    mTextureView.setSurfaceTextureListener(mSurfaceTextureListener);

    mAnchorSeekBar = (SeekBar)findViewById(R.id.anchor_seek_bar);
    mFoldLayout = (FoldingLayout)findViewById(R.id.fold_view);
    mFoldLayout.setBackgroundColor(Color.BLACK);
    mFoldLayout.setFoldListener(mOnFoldListener);

    mTouchSlop = ViewConfiguration.get(this).getScaledTouchSlop();

    mAnchorSeekBar.setOnSeekBarChangeListener(mSeekBarChangeListener);

    mScrollGestureDetector = new GestureDetector(this, new ScrollGestureDetector());
    mItemSelectedListener = new ItemSelectedListener();

    mDefaultPaint = new Paint();
    mSepiaPaint = new Paint();

    ColorMatrix m1 = new ColorMatrix();
    ColorMatrix m2 = new ColorMatrix();
    m1.setSaturation(0);
    m2.setScale(1f, .95f, .82f, 1.0f);
    m1.setConcat(m2, m1);
    mSepiaPaint.setColorFilter(new ColorMatrixColorFilter(m1));
}
 
開發者ID:sdrausty,項目名稱:buildAPKsSamples,代碼行數:38,代碼來源:FoldingLayoutActivity.java

示例2: setColorMode

import android.graphics.ColorMatrix; //導入方法依賴的package包/類
public void setColorMode(int mode) {
	mInvertPage = false;
	switch (mode) {
		case 0:
			mPaint.setColorFilter(null);
			 //setSoftwareRendering(); // Some devices get segfaults
			// in the WebView with Hardware Acceleration enabled,
			// the only fix is to disable hardware rendering
			//setNormalRendering();
			setHardwareRendering();
			mInvertPage = false;
			break;
		case 1:
			ColorMatrixColorFilter filterInvert = new ColorMatrixColorFilter(
					mNegativeColorArray);
			mPaint.setColorFilter(filterInvert);
			setHardwareRendering();

			mInvertPage = true;
			break;
		case 2:
			ColorMatrix cm = new ColorMatrix();
			cm.setSaturation(0);
			ColorMatrixColorFilter filterGray = new ColorMatrixColorFilter(cm);
			mPaint.setColorFilter(filterGray);
			setHardwareRendering();
			break;
		case 3:
			ColorMatrix matrix = new ColorMatrix();
			matrix.set(mNegativeColorArray);
			ColorMatrix matrixGray = new ColorMatrix();
			matrixGray.setSaturation(0);
			ColorMatrix concat = new ColorMatrix();
			concat.setConcat(matrix, matrixGray);
			ColorMatrixColorFilter filterInvertGray = new ColorMatrixColorFilter(concat);
			mPaint.setColorFilter(filterInvertGray);
			setHardwareRendering();

			mInvertPage = true;
			break;

	}

}
 
開發者ID:NewCasino,項目名稱:browser,代碼行數:45,代碼來源:LightningView.java

示例3: setColorMode

import android.graphics.ColorMatrix; //導入方法依賴的package包/類
/**
 * Sets the current rendering color of the WebView instance
 * of the current LightningView. The for modes are normal
 * rendering (0), inverted rendering (1), grayscale rendering (2),
 * and inverted grayscale rendering (3)
 *
 * @param mode the integer mode to set as the rendering mode.
 *             see the numbers in documentation above for the
 *             values this method accepts.
 */
private void setColorMode(int mode) {
    mInvertPage = false;
    switch (mode) {
        case 0:
            mPaint.setColorFilter(null);
            // setSoftwareRendering(); // Some devices get segfaults
            // in the WebView with Hardware Acceleration enabled,
            // the only fix is to disable hardware rendering
            setNormalRendering();
            mInvertPage = false;
            break;
        case 1:
            ColorMatrixColorFilter filterInvert = new ColorMatrixColorFilter(
                sNegativeColorArray);
            mPaint.setColorFilter(filterInvert);
            setHardwareRendering();

            mInvertPage = true;
            break;
        case 2:
            ColorMatrix cm = new ColorMatrix();
            cm.setSaturation(0);
            ColorMatrixColorFilter filterGray = new ColorMatrixColorFilter(cm);
            mPaint.setColorFilter(filterGray);
            setHardwareRendering();
            break;
        case 3:
            ColorMatrix matrix = new ColorMatrix();
            matrix.set(sNegativeColorArray);
            ColorMatrix matrixGray = new ColorMatrix();
            matrixGray.setSaturation(0);
            ColorMatrix concat = new ColorMatrix();
            concat.setConcat(matrix, matrixGray);
            ColorMatrixColorFilter filterInvertGray = new ColorMatrixColorFilter(concat);
            mPaint.setColorFilter(filterInvertGray);
            setHardwareRendering();

            mInvertPage = true;
            break;

        case 4:
            ColorMatrixColorFilter IncreaseHighContrast = new ColorMatrixColorFilter(
                sIncreaseContrastColorArray);
            mPaint.setColorFilter(IncreaseHighContrast);
            setHardwareRendering();
            break;

    }

}
 
開發者ID:XndroidDev,項目名稱:Xndroid,代碼行數:61,代碼來源:LightningView.java

示例4: setColorMode

import android.graphics.ColorMatrix; //導入方法依賴的package包/類
private void setColorMode(int mode) {
    mInvertPage = false;
    switch (mode) {
        case 0:
            mPaint.setColorFilter(null);
            // setSoftwareRendering(); // Some devices get segfaults
            // in the WebView with Hardware Acceleration enabled,
            // the only fix is to disable hardware rendering
           setNormalRendering();
            //setSoftwareRendering();
            mInvertPage = false;
            break;
        case 1:
            ColorMatrixColorFilter filterInvert = new ColorMatrixColorFilter(
                    mNegativeColorArray);
            mPaint.setColorFilter(filterInvert);
           // setSoftwareRendering();//setHardwareRendering();
            setHardwareRendering();
            mInvertPage = true;
            break;
        case 2:
            ColorMatrix cm = new ColorMatrix();
            cm.setSaturation(0);
            ColorMatrixColorFilter filterGray = new ColorMatrixColorFilter(cm);
            mPaint.setColorFilter(filterGray);
           // setSoftwareRendering();//setHardwareRendering();
            setHardwareRendering();
            break;
        case 3:
            ColorMatrix matrix = new ColorMatrix();
            matrix.set(mNegativeColorArray);
            ColorMatrix matrixGray = new ColorMatrix();
            matrixGray.setSaturation(0);
            ColorMatrix concat = new ColorMatrix();
            concat.setConcat(matrix, matrixGray);
            ColorMatrixColorFilter filterInvertGray = new ColorMatrixColorFilter(concat);
            mPaint.setColorFilter(filterInvertGray);
           // setSoftwareRendering();//setHardwareRendering();
            setHardwareRendering();

            mInvertPage = true;
            break;

    }

}
 
開發者ID:javadtaghia,項目名稱:DeeBrowser,代碼行數:47,代碼來源:LightningView.java


注:本文中的android.graphics.ColorMatrix.setConcat方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。