android.graphics.AvoidXfermode源码实例Demo

类android.graphics.AvoidXfermode源码实例Demo

下面列出了android.graphics.AvoidXfermode 类实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: starcor.xul   文件: XulGIFDecoder.java
public static GIFAnimationRender createAnimationRenderer(GIFFrame[] gifFrames, boolean noLoop, boolean noTransparent) {
	GIFAnimationRender render = new GIFAnimationRender();
	GIFFrame gifFrame0 = gifFrames[0];
	render._frameImage = BitmapTools.createBitmap(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;
}
 
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.");
	}
}
 
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);
}
 
如果文章对您有帮助,请点击页面广告。以鼓励作者做出的努力。
 类所在包
 类方法
 同包方法