• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java StreamBitmapDecoder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: loadFallbackPicture

import com.bumptech.glide.load.resource.bitmap.StreamBitmapDecoder; //导入依赖的package包/类
private void loadFallbackPicture(Address address, ImageView imageView) {
    Context context = imageView.getContext();

    Glide.with(context)
            .using(new FallbackGlideModelLoader(), FallbackGlideParams.class)
            .from(FallbackGlideParams.class)
            .as(Bitmap.class)
            .transcode(new BitmapToGlideDrawableTranscoder(context), GlideDrawable.class)
            .decoder(new FallbackGlideBitmapDecoder(context))
            .encoder(new BitmapEncoder(Bitmap.CompressFormat.PNG, 0))
            .cacheDecoder(new FileToStreamDecoder<>(new StreamBitmapDecoder(context)))
            .diskCacheStrategy(DiskCacheStrategy.NONE)
            .load(new FallbackGlideParams(address))
            // for some reason, following 2 lines fix loading issues.
            .dontAnimate()
            .override(mPictureSizeInPx, mPictureSizeInPx)
            .into(imageView);
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:19,代码来源:ContactPictureLoader.java


示例2: GifFrameManager

import com.bumptech.glide.load.resource.bitmap.StreamBitmapDecoder; //导入依赖的package包/类
public GifFrameManager(Context context, GifDecoder decoder, Handler mainHandler,
        Transformation<Bitmap> transformation) {
    this.context = context;
    this.decoder = decoder;
    this.mainHandler = mainHandler;
    this.transformation = transformation;
    calculator = new MemorySizeCalculator(context);
    frameLoader = new GifFrameModelLoader();
    frameResourceDecoder = new GifFrameResourceDecoder();

    if (!decoder.isTransparent()) {
        // For non transparent gifs, we can beat the performance of our gif decoder for each frame by decoding jpegs
        // from disk.
        cacheDecoder = new StreamBitmapDecoder(context);
        encoder = new BitmapEncoder(Bitmap.CompressFormat.JPEG, 70);
    } else {
        // For transparent gifs, we would have to encode as pngs which is actually slower than our gif decoder so we
        // avoid writing frames to the disk cache entirely.
        cacheDecoder = NullCacheDecoder.get();
        encoder = SkipCache.get();
    }
}
 
开发者ID:The-WebOps-Club,项目名称:saarang-iosched,代码行数:23,代码来源:GifFrameManager.java


示例3: ImageWrapperStreamResourceDecoder

import com.bumptech.glide.load.resource.bitmap.StreamBitmapDecoder; //导入依赖的package包/类
public ImageWrapperStreamResourceDecoder(Context context) {
    StreamBitmapDecoder streamBitmapDecoder = new StreamBitmapDecoder(context);
    FileDescriptorBitmapDecoder fileDescriptorBitmapDecoder = new FileDescriptorBitmapDecoder(context);
    ImageVideoBitmapDecoder imageVideoBitmapDecoder = new ImageVideoBitmapDecoder(streamBitmapDecoder, fileDescriptorBitmapDecoder);
    GifResourceDecoder gifResourceDecoder = new GifResourceDecoder();
    BitmapPool bitmapPool = Glide.get(context).getBitmapPool();
    this.gifBitmapDecoder = new ImageWrapperResourceDecoder(imageVideoBitmapDecoder, gifResourceDecoder, bitmapPool);
}
 
开发者ID:dengyuhan,项目名称:GlidePlus,代码行数:9,代码来源:ImageWrapperStreamResourceDecoder.java


示例4: BitmapRequestBuilder

import com.bumptech.glide.load.resource.bitmap.StreamBitmapDecoder; //导入依赖的package包/类
BitmapRequestBuilder(Context context, ModelType model,
        LoadProvider<ModelType, ImageVideoWrapper, Bitmap, TranscodeType> streamLoadProvider,
        Class<TranscodeType> transcodeClass, Glide glide) {
    super(context, model, streamLoadProvider, transcodeClass, glide);
    this.bitmapPool = glide.getBitmapPool();

    imageDecoder = new StreamBitmapDecoder(bitmapPool);
    videoDecoder = new FileDescriptorBitmapDecoder(bitmapPool);
}
 
开发者ID:The-WebOps-Club,项目名称:saarang-iosched,代码行数:10,代码来源:BitmapRequestBuilder.java


示例5: downsample

import com.bumptech.glide.load.resource.bitmap.StreamBitmapDecoder; //导入依赖的package包/类
/**
 * Load images using the given {@link Downsampler}. Replaces any existing image decoder. Defaults to
 * {@link Downsampler#AT_LEAST}. Will be ignored if the data represented by the model is a video. This replaces any
 * previous calls to {@link #imageDecoder(ResourceDecoder)}  and {@link #decoder(ResourceDecoder)} with default
 * decoders with the appropriate options set.
 *
 * @see #imageDecoder
 *
 * @param downsampler The downsampler
 * @return This RequestBuilder
 */
private BitmapRequestBuilder<ModelType, TranscodeType> downsample(Downsampler downsampler) {
    this.downsampler = downsampler;
    imageDecoder = new StreamBitmapDecoder(downsampler, bitmapPool, decodeFormat);
    super.decoder(new ImageVideoBitmapDecoder(imageDecoder, videoDecoder));
    return this;
}
 
开发者ID:The-WebOps-Club,项目名称:saarang-iosched,代码行数:18,代码来源:BitmapRequestBuilder.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java XmlTagNameProvider类代码示例发布时间:2022-05-23
下一篇:
Java ValueStore类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap