• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java GrayscaleTransformation类的典型用法和代码示例

java 1次浏览

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

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

示例1: load

点赞 3

import jp.wasabeef.glide.transformations.GrayscaleTransformation; //导入依赖的package包/类
@Override protected void load(Context context) throws Exception {
	String urlString = "http://web.twisterrob.net/glide/1257_changing.php";
	Glide
			.with(this)
			.load(new ForceLoadGlideUrl(urlString))
			.fitCenter()
			.diskCacheStrategy(DiskCacheStrategy.NONE)
			.skipMemoryCache(true)
			//.placeholder(R.drawable.glide_placeholder)
			//.error(R.drawable.glide_error)
			.listener(new LoggingListener<GlideUrl, GlideDrawable>("full"))
			.thumbnail(Glide
					.with(this)
					.load(new CachedGlideUrl(urlString))
					.diskCacheStrategy(DiskCacheStrategy.NONE)
					.skipMemoryCache(true)
					.listener(new LoggingListener<GlideUrl, GlideDrawable>("thumbnail"))
					.bitmapTransform(new FitCenter(context), new GrayscaleTransformation(context))
					.sizeMultiplier(0.25f)
			)
			.into(imageView);
}
 

开发者ID:TWiStErRob,
项目名称:glide-support,
代码行数:23,
代码来源:TestFragment.java

示例2: getTransform

点赞 2

import jp.wasabeef.glide.transformations.GrayscaleTransformation; //导入依赖的package包/类
Transformation<Bitmap> getTransform(int position, Context mContext) {
    if (position % 19 == 0) {
        return new CropCircleTransformation(mContext);
    } else if (position % 19 == 1) {
        return new RoundedCornersTransformation(mContext, 30, 0,
                RoundedCornersTransformation.CornerType.BOTTOM);

    } else if (position % 19 == 2) {
        return new CropTransformation(mContext, 300, 100, CropTransformation.CropType.BOTTOM);

    } else if (position % 19 == 3) {
        return new CropSquareTransformation(mContext);

    } else if (position % 19 == 4) {
        return new CropTransformation(mContext, 300, 100, CropTransformation.CropType.CENTER);

    } else if (position % 19 == 5) {
        return new ColorFilterTransformation(mContext, Color.argb(80, 255, 0, 0));

    } else if (position % 19 == 6) {
        return new GrayscaleTransformation(mContext);

    } else if (position % 19 == 7) {
        return new CropTransformation(mContext, 300, 100);

    } else if (position % 19 == 8) {
        return new BlurTransformation(mContext, 25);
    } else if (position % 19 == 9) {
        return new ToonFilterTransformation(mContext);

    } else if (position % 19 == 10) {
        return new SepiaFilterTransformation(mContext);

    } else if (position % 19 == 11) {
        return new ContrastFilterTransformation(mContext, 2.0f);
    } else if (position % 19 == 12) {
        return new InvertFilterTransformation(mContext);
    } else if (position % 19 == 13) {
        return new PixelationFilterTransformation(mContext, 20);
    } else if (position % 19 == 14) {
        return new SketchFilterTransformation(mContext);
    } else if (position % 19 == 15) {
        return new SwirlFilterTransformation(mContext, 0.5f, 1.0f, new PointF(0.5f, 0.5f));
    } else if (position % 19 == 16) {
        return new BrightnessFilterTransformation(mContext, 0.5f);
    } else if (position % 19 == 17) {
        return new KuwaharaFilterTransformation(mContext, 25);
    } else if (position % 19 == 18) {
        return new VignetteFilterTransformation(mContext, new PointF(0.5f, 0.5f),
                new float[]{0.0f, 0.0f, 0.0f}, 0f, 0.75f);
    }
    return null;
}
 

开发者ID:cymcsg,
项目名称:UltimateAndroid,
代码行数:54,
代码来源:RepositoryAdapter.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)