当前位置: 首页>>代码示例>>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;未经允许,请勿转载。