本文整理汇总了Java中android.graphics.EmbossMaskFilter类的典型用法代码示例。如果您正苦于以下问题:Java EmbossMaskFilter类的具体用法?Java EmbossMaskFilter怎么用?Java EmbossMaskFilter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EmbossMaskFilter类属于android.graphics包,在下文中一共展示了EmbossMaskFilter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setPaintMaskFilter
import android.graphics.EmbossMaskFilter; //导入依赖的package包/类
public void setPaintMaskFilter(int mode) {
switch (mode) {
case UsoppBubble.MODE_NONE:
break;
case UsoppBubble.MODE_GLOW:
mDataBean.mFilter = new BlurMaskFilter(10, BlurMaskFilter.Blur.OUTER);
break;
case UsoppBubble.MODE_EMBOSS:
float[] direction = new float[]{10, 10, 10};
float ambient = 0.5f;
float specular = 1;
float blurRadius = 1;
mDataBean.mFilter = new EmbossMaskFilter(direction, ambient, specular, blurRadius);
break;
}
mDataBean.mPaint.setMaskFilter(mDataBean.mFilter);
}
示例2: AbHorizontalProgressBar
import android.graphics.EmbossMaskFilter; //导入依赖的package包/类
/**
* Instantiates a new ab horizontal progress bar.
*
* @param context the context
* @param attrs the attrs
*/
public AbHorizontalProgressBar(Context context, AttributeSet attrs) {
super(context, attrs);
pathPaint = new Paint();
// 设置是否抗锯齿
pathPaint.setAntiAlias(true);
// 帮助消除锯齿
pathPaint.setFlags(Paint.ANTI_ALIAS_FLAG);
// 设置中空的样式
pathPaint.setStyle(Paint.Style.FILL);
pathPaint.setDither(true);
//pathPaint.setStrokeJoin(Paint.Join.ROUND);
fillPaint = new Paint();
// 设置是否抗锯齿
fillPaint.setAntiAlias(true);
// 帮助消除锯齿
fillPaint.setFlags(Paint.ANTI_ALIAS_FLAG);
// 设置中空的样式
fillPaint.setStyle(Paint.Style.FILL);
fillPaint.setDither(true);
//fillPaint.setStrokeJoin(Paint.Join.ROUND);
emboss = new EmbossMaskFilter(direction,light,specular,blur);
mBlur = new BlurMaskFilter(20, BlurMaskFilter.Blur.NORMAL);
}
示例3: ZLAndroidPaintContext
import android.graphics.EmbossMaskFilter; //导入依赖的package包/类
ZLAndroidPaintContext(Canvas canvas, int width, int height, int scrollbarWidth) {
myCanvas = canvas;
myWidth = width - scrollbarWidth;
myHeight = height;
myScrollbarWidth = scrollbarWidth;
myTextPaint.setLinearText(false);
myTextPaint.setAntiAlias(AntiAliasOption.getValue());
if (DeviceKerningOption.getValue()) {
myTextPaint.setFlags(myTextPaint.getFlags() | Paint.DEV_KERN_TEXT_FLAG);
} else {
myTextPaint.setFlags(myTextPaint.getFlags() & ~Paint.DEV_KERN_TEXT_FLAG);
}
myTextPaint.setDither(DitheringOption.getValue());
myTextPaint.setSubpixelText(SubpixelOption.getValue());
myLinePaint.setStyle(Paint.Style.STROKE);
myOutlinePaint.setColor(Color.rgb(255, 127, 0));
myOutlinePaint.setAntiAlias(true);
myOutlinePaint.setDither(true);
myOutlinePaint.setStrokeWidth(4);
myOutlinePaint.setStyle(Paint.Style.STROKE);
myOutlinePaint.setPathEffect(new CornerPathEffect(5));
myOutlinePaint.setMaskFilter(new EmbossMaskFilter(new float[] {1, 1, 1}, .4f, 6f, 3.5f));
}
示例4: emboss
import android.graphics.EmbossMaskFilter; //导入依赖的package包/类
/**
* @see EmbossMaskFilter#EmbossMaskFilter(float[], float, float, float)
*/
public static Span emboss(@NonNull final float[] direction, final float ambient, final float specular, final float blurRadius) {
return new Span(new SpanBuilder() {
@Override
public Object build() {
return new MaskFilterSpan(new EmbossMaskFilter(direction, ambient, specular, blurRadius));
}
});
}
示例5: emboss
import android.graphics.EmbossMaskFilter; //导入依赖的package包/类
public TextDecorator emboss(final float[] direction, final float ambient, final float specular, final float blurRadius, final int start, final int end) {
checkIndexOutOfBoundsException(start, end);
decoratedContent.setSpan(new MaskFilterSpan(new EmbossMaskFilter(direction, ambient, specular, blurRadius)), start, end,
flags);
return this;
}
示例6: updateEmboss
import android.graphics.EmbossMaskFilter; //导入依赖的package包/类
private void updateEmboss() {
if (isInEditMode())
return;
if (!withEffects3D) {
tubePaint.setMaskFilter(null);
tubeBacPaint.setMaskFilter(null);
return;
}
EmbossMaskFilter embossMaskFilter = new EmbossMaskFilter(
new float[] { .5f, 1f, 1f }, .6f, 3f, pxTOdp(getSpeedometerWidth())*.35f);
tubePaint.setMaskFilter(embossMaskFilter);
EmbossMaskFilter embossMaskFilterBac = new EmbossMaskFilter(
new float[] { -.5f, -1f, 0f }, .6f, 1f, pxTOdp(getSpeedometerWidth())*.35f);
tubeBacPaint.setMaskFilter(embossMaskFilterBac);
}
示例7: AbCircleProgressBar
import android.graphics.EmbossMaskFilter; //导入依赖的package包/类
/**
* Instantiates a new ab circle progress bar.
*
* @param context the context
* @param attrs the attrs
*/
public AbCircleProgressBar(Context context, AttributeSet attrs) {
super(context, attrs);
pathPaint = new Paint();
// 设置是否抗锯齿
pathPaint.setAntiAlias(true);
// 帮助消除锯齿
pathPaint.setFlags(Paint.ANTI_ALIAS_FLAG);
// 设置中空的样式
pathPaint.setStyle(Paint.Style.STROKE);
pathPaint.setDither(true);
pathPaint.setStrokeJoin(Paint.Join.ROUND);
fillArcPaint = new Paint();
// 设置是否抗锯齿
fillArcPaint.setAntiAlias(true);
// 帮助消除锯齿
fillArcPaint.setFlags(Paint.ANTI_ALIAS_FLAG);
// 设置中空的样式
fillArcPaint.setStyle(Paint.Style.STROKE);
fillArcPaint.setDither(true);
fillArcPaint.setStrokeJoin(Paint.Join.ROUND);
oval = new RectF();
emboss = new EmbossMaskFilter(direction,light,specular,blur);
mBlur = new BlurMaskFilter(20, BlurMaskFilter.Blur.NORMAL);
}
示例8: preparePainters
import android.graphics.EmbossMaskFilter; //导入依赖的package包/类
private void preparePainters() {
borderPencil = new Paint(Paint.ANTI_ALIAS_FLAG);
borderPencil.setStrokeWidth(0.5f);
borderPencil.setColor(0xFF6d6968);
borderPencil.setStyle(Paint.Style.STROKE);
itemDefaultColor = new Paint(Paint.ANTI_ALIAS_FLAG);
itemDefaultColor.setStyle(Paint.Style.FILL);
itemDefaultColor.setColor(0xfff3f3f3);
itemTouchedBack = new Paint(Paint.ANTI_ALIAS_FLAG);
itemTouchedBack.setColor(0xffFFFFFF);
itemTouchedBack.setStyle(Paint.Style.FILL);
rainbowBorderPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
rainbowBorderPaint.setStyle(Paint.Style.STROKE);
rainbowBorderPaint.setStrokeWidth(CircleMenuSettings.rainbowCircleBorderWidth);
smallBorderPencil = new Paint(Paint.ANTI_ALIAS_FLAG);
smallBorderPencil.setColor(0xFFE6E6E6);
smallBorderPencil.setStyle(Paint.Style.FILL);
forBig = new EmbossMaskFilter(new float[] { 1, 1, 1 }, 1f, 4, 2.5f);
itemDefaultColor.setMaskFilter(forBig);
}
示例9: init
import android.graphics.EmbossMaskFilter; //导入依赖的package包/类
/**
* 그래프 초기화
*/
public void init(){
super.setWillNotDraw(false);
isSizeToScale = true;
strokSize = -1;
isBackArc = false;
Arc backArc;
arcMargin=0;
startAngle=0;
maxAngle=360;
isCapRound = false;
emboss = new EmbossMaskFilter(new float[]{-1,-1,1},0.7f,3,4);
isInitpieSkin = false;
density = getContext().getResources().getDisplayMetrics().density;
strokScale = 1.0f;
if(arcs.size()>0 || pieSkin.size()>0){
pieSkin.clear();
arcs.clear();
this.invalidate();
}
}
示例10: embossPen
import android.graphics.EmbossMaskFilter; //导入依赖的package包/类
private void embossPen()
{
MaskFilter mEmboss = new EmbossMaskFilter(new float[]{ 1, 1, 1 }, 0.4f, 6, 3.5f);
mPenPaint.setDither(true);
mPenPaint.setAntiAlias(true);
mPenPaint.setStyle(Paint.Style.STROKE);
mPenPaint.setStrokeJoin(Paint.Join.ROUND);
mPenPaint.setStrokeCap(Paint.Cap.ROUND);
mPenPaint.setMaskFilter(mEmboss);
}
示例11: applyFilter
import android.graphics.EmbossMaskFilter; //导入依赖的package包/类
private void applyFilter(
TextView textView, float[] direction, float ambient, float specular, float blurRadius) {
if (Build.VERSION.SDK_INT >= 11) {
ViewUtil.setSoftwareLayerType(textView);
}
EmbossMaskFilter filter = new EmbossMaskFilter(direction, ambient, specular, blurRadius);
textView.getPaint().setMaskFilter(filter);
}
示例12: setMaskFilter
import android.graphics.EmbossMaskFilter; //导入依赖的package包/类
public Arc setMaskFilter(EmbossMaskFilter emboss){
this.emboss = emboss;
init();
return this;
}
示例13: getMaskFilter
import android.graphics.EmbossMaskFilter; //导入依赖的package包/类
public EmbossMaskFilter getMaskFilter(){
return emboss;
}
示例14: setMaskFilter
import android.graphics.EmbossMaskFilter; //导入依赖的package包/类
public void setMaskFilter(EmbossMaskFilter emboss){
for(int i=0;i<arcs.size();i++){
Arc arc = arcs.get(i);
arc.setMaskFilter(emboss);
}
}
示例15: setEmboss
import android.graphics.EmbossMaskFilter; //导入依赖的package包/类
public void setEmboss(EmbossMaskFilter emboss){
this.emboss = emboss;
}