当前位置: 首页>>代码示例>>Java>>正文


Java AvoidXfermode类代码示例

本文整理汇总了Java中android.graphics.AvoidXfermode的典型用法代码示例。如果您正苦于以下问题:Java AvoidXfermode类的具体用法?Java AvoidXfermode怎么用?Java AvoidXfermode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AvoidXfermode类属于android.graphics包,在下文中一共展示了AvoidXfermode类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createAnimationRenderer

import android.graphics.AvoidXfermode; //导入依赖的package包/类
public static GIFAnimationRender createAnimationRenderer(GIFFrame[] gifFrames, boolean noLoop, boolean noTransparent) {
	GIFAnimationRender render = new GIFAnimationRender();
	GIFFrame gifFrame0 = gifFrames[0];
	render._frameImage = BitmapTools.createBitmapFromRecycledBitmaps(gifFrame0._screenW, gifFrame0._screenH, Bitmap.Config.ARGB_8888);
	render._gifFrames = gifFrames;
	render._isCurrentFrameDecoded = false;
	render._currentFrame = 0;
	render._noLoop = noLoop;
	if (noTransparent || gifFrame0._backgroundColor == 0xFFFFFF) {
		render._colorKeyXferMode = null;
	} else {
		render._colorKeyXferMode = new AvoidXfermode(gifFrame0._backgroundColor, 0, AvoidXfermode.Mode.AVOID);
	}
	//render._colorKeyXferMode = new PixelXorXfermode(gifFrame0._backgroundColor);
	return render;
}
 
开发者ID:starcor-company,项目名称:starcor.xul,代码行数:17,代码来源:XulGIFDecoder.java

示例2: initPaint

import android.graphics.AvoidXfermode; //导入依赖的package包/类
/**
 * 初始化画笔
 */
private void initPaint() {
    // 实例化画笔
    mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);

    /*
     * 当画布中有跟0XFFFFFFFF色不一样的地方时候才“染”色
     */
    avoidXfermode = new AvoidXfermode(0XFFFFFFFF, 0, AvoidXfermode.Mode.TARGET);
}
 
开发者ID:cowthan,项目名称:AyoSunny,代码行数:13,代码来源:XfermodeAvoidImageView.java

示例3: initPaint

import android.graphics.AvoidXfermode; //导入依赖的package包/类
/**
 * 初始化画笔
 */
private void initPaint() {
	// 实例化画笔
	mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);

	/*
	 * 当画布中有跟0XFFFFFFFF色不一样的地方时候才“染”色
	 */
	avoidXfermode = new AvoidXfermode(0XFFFFFFFF, 255, AvoidXfermode.Mode.AVOID);
}
 
开发者ID:cowthan,项目名称:AyoSunny,代码行数:13,代码来源:CustomView.java

示例4: ColorSwapBitmapTextureAtlasSourceDecorator

import android.graphics.AvoidXfermode; //导入依赖的package包/类
public ColorSwapBitmapTextureAtlasSourceDecorator(final IBitmapTextureAtlasSource pBitmapTextureAtlasSource, final IBitmapTextureAtlasSourceDecoratorShape pBitmapTextureAtlasSourceDecoratorShape, final int pColorKeyColorARGBPackedInt, final int pTolerance, final int pColorSwapColorARGBPackedInt, final TextureAtlasSourceDecoratorOptions pTextureAtlasSourceDecoratorOptions) {
	super(pBitmapTextureAtlasSource, pBitmapTextureAtlasSourceDecoratorShape, pTextureAtlasSourceDecoratorOptions);

	this.mColorKeyColorARGBPackedInt = pColorKeyColorARGBPackedInt;
	this.mTolerance = pTolerance;
	this.mColorSwapColorARGBPackedInt = pColorSwapColorARGBPackedInt;
	this.mPaint.setXfermode(new AvoidXfermode(pColorKeyColorARGBPackedInt, pTolerance, Mode.TARGET));
	this.mPaint.setColor(pColorSwapColorARGBPackedInt);

	if (SystemUtils.isAndroidVersionOrHigher(Build.VERSION_CODES.JELLY_BEAN)) {
		Debug.w("The class " + ColorSwapBitmapTextureAtlasSourceDecorator.class.getSimpleName() + " is deprecated for Android API Level: '" + Build.VERSION_CODES.JELLY_BEAN + "' and higher, since the class " + AvoidXfermode.class.getSimpleName() + " is deprecated since then.");
	}
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:14,代码来源:ColorSwapBitmapTextureAtlasSourceDecorator.java

示例5: ColorSwapBitmapTextureAtlasSourceDecorator

import android.graphics.AvoidXfermode; //导入依赖的package包/类
public ColorSwapBitmapTextureAtlasSourceDecorator(final IBitmapTextureAtlasSource pBitmapTextureAtlasSource, final IBitmapTextureAtlasSourceDecoratorShape pBitmapTextureAtlasSourceDecoratorShape, final int pColorKeyColorARGBPackedInt, final int pTolerance, final int pColorSwapColorARGBPackedInt, final TextureAtlasSourceDecoratorOptions pTextureAtlasSourceDecoratorOptions) {
	super(pBitmapTextureAtlasSource, pBitmapTextureAtlasSourceDecoratorShape, pTextureAtlasSourceDecoratorOptions);

	this.mColorKeyColorARGBPackedInt = pColorKeyColorARGBPackedInt;
	this.mTolerance = pTolerance;
	this.mColorSwapColorARGBPackedInt = pColorSwapColorARGBPackedInt;
	this.mPaint.setXfermode(new AvoidXfermode(pColorKeyColorARGBPackedInt, pTolerance, Mode.TARGET));
	this.mPaint.setColor(pColorSwapColorARGBPackedInt);
}
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:10,代码来源:ColorSwapBitmapTextureAtlasSourceDecorator.java

示例6: onCreate

import android.graphics.AvoidXfermode; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.xfermode_layout);
	ButterKnife.inject(this);

	avoid_mode_target.setAvoidXfermode(AvoidXfermode.Mode.TARGET);
	avoid_mode_avoid.setAvoidXfermode(AvoidXfermode.Mode.AVOID);
}
 
开发者ID:xu6148152,项目名称:binea_project_for_android,代码行数:10,代码来源:XfermodeActivity.java

示例7: ColorSwapTextureSourceDecorator

import android.graphics.AvoidXfermode; //导入依赖的package包/类
public ColorSwapTextureSourceDecorator(final ITextureSource pTextureSource, final ITextureSourceDecoratorShape pTextureSourceDecoratorShape, final int pColorKeyColor, final int pTolerance, final int pColorSwapColor, final TextureSourceDecoratorOptions pTextureSourceDecoratorOptions) {
	super(pTextureSource, pTextureSourceDecoratorShape, pTextureSourceDecoratorOptions);
	this.mColorKeyColor = pColorKeyColor;
	this.mTolerance = pTolerance;
	this.mColorSwapColor = pColorSwapColor;
	this.mPaint.setXfermode(new AvoidXfermode(pColorKeyColor, pTolerance, Mode.TARGET));
	this.mPaint.setColor(pColorSwapColor);
}
 
开发者ID:liufeiit,项目名称:itmarry,代码行数:9,代码来源:ColorSwapTextureSourceDecorator.java

示例8: getRoundedCornerBitmap

import android.graphics.AvoidXfermode; //导入依赖的package包/类
public static Bitmap getRoundedCornerBitmap(Context context, Bitmap bitmap,
                                            float upperLeft, float upperRight, float lowerRight,
                                            float lowerLeft, int endWidth, int endHeight) {
    final float densityMultiplier = context.getResources()
            .getDisplayMetrics().density;

    // scale incoming bitmap to appropriate px size given arguments and
    // display dpi
    bitmap = Bitmap.createScaledBitmap(bitmap,
            Math.round(endWidth * densityMultiplier),
            Math.round(endHeight * densityMultiplier), true);

    // create empty bitmap for drawing
    final Bitmap output = Bitmap.createBitmap(
            Math.round(endWidth * densityMultiplier),
            Math.round(endHeight * densityMultiplier), Config.ARGB_8888);

    // get canvas for empty bitmap
    final Canvas canvas = new Canvas(output);
    final int width = canvas.getWidth();
    final int height = canvas.getHeight();

    // scale the rounded corners appropriately given dpi
    upperLeft *= densityMultiplier;
    upperRight *= densityMultiplier;
    lowerRight *= densityMultiplier;
    lowerLeft *= densityMultiplier;

    final Paint paint = new Paint();
    paint.setAntiAlias(true);
    paint.setColor(Color.WHITE);

    // fill the canvas with transparency
    canvas.drawARGB(0, 0, 0, 0);

    // draw the rounded corners around the image rect. clockwise, starting
    // in upper left.
    canvas.drawCircle(upperLeft, upperLeft, upperLeft, paint);
    canvas.drawCircle(width - upperRight, upperRight, upperRight, paint);
    canvas.drawCircle(width - lowerRight, height - lowerRight, lowerRight,
            paint);
    canvas.drawCircle(lowerLeft, height - lowerLeft, lowerLeft, paint);

    // fill in all the gaps between circles. clockwise, starting at top.
    final RectF rectT = new RectF(upperLeft, 0, width - upperRight,
            height / 2);
    final RectF rectR = new RectF(width / 2, upperRight, width, height
            - lowerRight);
    final RectF rectB = new RectF(lowerLeft, height / 2,
            width - lowerRight, height);
    final RectF rectL = new RectF(0, upperLeft, width / 2, height
            - lowerLeft);

    canvas.drawRect(rectT, paint);
    canvas.drawRect(rectR, paint);
    canvas.drawRect(rectB, paint);
    canvas.drawRect(rectL, paint);

    // set up the rect for the image
    final Rect imageRect = new Rect(0, 0, width, height);

    // set up paint object such that it only paints on Color.WHITE
    paint.setXfermode(new AvoidXfermode(Color.WHITE, 255,
            AvoidXfermode.Mode.TARGET));

    // draw resized bitmap onto imageRect in canvas, using paint as
    // configured above
    canvas.drawBitmap(bitmap, imageRect, imageRect, paint);

    return output;
}
 
开发者ID:AAPBD,项目名称:AppBajarLIB,代码行数:72,代码来源:RoundedCornerBitmap.java

示例9: setAvoidXfermode

import android.graphics.AvoidXfermode; //导入依赖的package包/类
public void setAvoidXfermode(AvoidXfermode.Mode mode){
	avoidXfermode = new AvoidXfermode(0XFFFFFFFF, 0, mode);
}
 
开发者ID:xu6148152,项目名称:binea_project_for_android,代码行数:4,代码来源:CustomBitmapView.java


注:本文中的android.graphics.AvoidXfermode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。