本文整理汇总了Java中android.graphics.MaskFilter类的典型用法代码示例。如果您正苦于以下问题:Java MaskFilter类的具体用法?Java MaskFilter怎么用?Java MaskFilter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MaskFilter类属于android.graphics包,在下文中一共展示了MaskFilter类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: RichPolygon
import android.graphics.MaskFilter; //导入依赖的package包/类
RichPolygon(final int zIndex,
final List<RichPoint> points,
final List<List<RichPoint>> holes,
final int strokeWidth,
final Paint.Cap strokeCap,
final Paint.Join strokeJoin,
final PathEffect pathEffect,
final MaskFilter maskFilter,
final boolean linearGradient,
final Integer strokeColor,
final boolean antialias,
final boolean closed,
final Shader strokeShader,
final Shader fillShader,
final Paint.Style style,
final Integer fillColor) {
super(zIndex, points, strokeWidth, strokeCap, strokeJoin, pathEffect, maskFilter,
strokeShader, linearGradient, strokeColor, antialias, closed);
this.fillShader = fillShader;
this.style = style;
this.fillColor = fillColor;
if (holes != null) {
addHoles(holes);
}
}
示例2: hasMaskFilter
import android.graphics.MaskFilter; //导入依赖的package包/类
public S hasMaskFilter(MaskFilter filter) {
assertThat(actual().getMaskFilter())
.named("mask filter")
.isSameAs(filter);
//noinspection unchecked
return (S) this;
}
示例3: RichShape
import android.graphics.MaskFilter; //导入依赖的package包/类
RichShape(final int zIndex,
final List<RichPoint> points,
final int strokeWidth,
final Paint.Cap strokeCap,
final Paint.Join strokeJoin,
final PathEffect pathEffect,
final MaskFilter maskFilter,
final Shader strokeShader,
final boolean linearGradient,
final Integer strokeColor,
final boolean antialias,
final boolean closed) {
this.zIndex = zIndex;
this.strokeWidth = strokeWidth;
this.strokeCap = strokeCap;
this.strokeJoin = strokeJoin;
this.pathEffect = pathEffect;
this.maskFilter = maskFilter;
this.strokeShader = strokeShader;
this.linearGradient = linearGradient;
this.strokeColor = strokeColor;
this.antialias = antialias;
this.closed = closed;
if (points != null) {
for (RichPoint point : points) {
add(point);
}
}
}
示例4: RichPolyline
import android.graphics.MaskFilter; //导入依赖的package包/类
RichPolyline(final int zIndex,
final List<RichPoint> points,
final int strokeWidth,
final Paint.Cap strokeCap,
final Paint.Join strokeJoin,
final PathEffect pathEffect,
final MaskFilter maskFilter,
final Shader strokeShader,
final boolean linearGradient,
final Integer strokeColor,
final boolean antialias,
final boolean closed) {
super(zIndex, points, strokeWidth, strokeCap, strokeJoin, pathEffect, maskFilter,
strokeShader, linearGradient, strokeColor, antialias, closed);
}
示例5: embossPen
import android.graphics.MaskFilter; //导入依赖的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);
}
示例6: blurPen
import android.graphics.MaskFilter; //导入依赖的package包/类
private void blurPen()
{
MaskFilter mBlur = new BlurMaskFilter(8, BlurMaskFilter.Blur.NORMAL);
mPenPaint.setDither(true);
mPenPaint.setAntiAlias(true);
mPenPaint.setStyle(Paint.Style.STROKE);
mPenPaint.setStrokeJoin(Paint.Join.ROUND);
mPenPaint.setStrokeCap(Paint.Cap.ROUND);
mPenPaint.setMaskFilter(mBlur);
}
示例7: HolographicOutlineHelper
import android.graphics.MaskFilter; //导入依赖的package包/类
HolographicOutlineHelper() {
mHolographicPaint.setFilterBitmap(true);
mHolographicPaint.setAntiAlias(true);
mBlurPaint.setFilterBitmap(true);
mBlurPaint.setAntiAlias(true);
mErasePaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_OUT));
mErasePaint.setFilterBitmap(true);
mErasePaint.setAntiAlias(true);
MaskFilter alphaClipTable = TableMaskFilter.CreateClipTable(180, 255);
mAlphaClipPaint.setMaskFilter(alphaClipTable);
}
示例8: hasMaskFilter
import android.graphics.MaskFilter; //导入依赖的package包/类
public S hasMaskFilter(MaskFilter filter) {
isNotNull();
MaskFilter actualFilter = actual.getMaskFilter();
assertThat(actualFilter) //
.overridingErrorMessage("Expected mask filter <%s> but was <%s>.", filter, actualFilter) //
.isSameAs(filter);
return myself;
}
示例9: mask
import android.graphics.MaskFilter; //导入依赖的package包/类
public static Node mask(MaskFilter filter, Object... nodes) {
return new SpanNode(new MaskFilterSpan(filter), nodes);
}
示例10: MaskFilterSpan
import android.graphics.MaskFilter; //导入依赖的package包/类
public MaskFilterSpan(MaskFilter filter) {
mFilter = filter;
}
示例11: getMaskFilter
import android.graphics.MaskFilter; //导入依赖的package包/类
public MaskFilter getMaskFilter() {
return mFilter;
}
示例12: beginDraggingWidget
import android.graphics.MaskFilter; //导入依赖的package包/类
private void beginDraggingWidget(View v) {
// Get the widget preview as the drag representation
ImageView image = (ImageView) v.findViewById(R.id.widget_preview);
PendingAddItemInfo createItemInfo = (PendingAddItemInfo) v.getTag();
// Compose the drag image
Bitmap b;
Drawable preview = image.getDrawable();
RectF mTmpScaleRect = new RectF(0f,0f,1f,1f);
image.getImageMatrix().mapRect(mTmpScaleRect);
float scale = mTmpScaleRect.right;
int w = (int) (preview.getIntrinsicWidth() * scale);
int h = (int) (preview.getIntrinsicHeight() * scale);
if (createItemInfo instanceof PendingAddWidgetInfo) {
PendingAddWidgetInfo createWidgetInfo = (PendingAddWidgetInfo) createItemInfo;
int[] spanXY = mLauncher.getSpanForWidget(createWidgetInfo, null);
createItemInfo.spanX = spanXY[0];
createItemInfo.spanY = spanXY[1];
b = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
renderDrawableToBitmap(preview, b, 0, 0, w, h, scale, mDragViewMultiplyColor);
} else {
// Workaround for the fact that we don't keep the original ResolveInfo associated with
// the shortcut around. To get the icon, we just render the preview image (which has
// the shortcut icon) to a new drag bitmap that clips the non-icon space.
b = Bitmap.createBitmap(mWidgetPreviewIconPaddedDimension,
mWidgetPreviewIconPaddedDimension, Bitmap.Config.ARGB_8888);
mCanvas.setBitmap(b);
mCanvas.save();
preview.draw(mCanvas);
mCanvas.restore();
mCanvas.drawColor(mDragViewMultiplyColor, PorterDuff.Mode.MULTIPLY);
mCanvas.setBitmap(null);
createItemInfo.spanX = createItemInfo.spanY = 1;
}
// We use a custom alpha clip table for the default widget previews
Paint alphaClipPaint = null;
if (createItemInfo instanceof PendingAddWidgetInfo) {
if (((PendingAddWidgetInfo) createItemInfo).hasDefaultPreview) {
MaskFilter alphaClipTable = TableMaskFilter.CreateClipTable(0, 255);
alphaClipPaint = new Paint();
alphaClipPaint.setMaskFilter(alphaClipTable);
}
}
// Start the drag
mLauncher.lockScreenOrientationOnLargeUI();
mLauncher.getWorkspace().onDragStartedWithItemSpans(createItemInfo.spanX,
createItemInfo.spanY, b, alphaClipPaint);
mDragController.startDrag(image, b, this, createItemInfo,
DragController.DRAG_ACTION_COPY, null);
b.recycle();
}