desmond1121 / fresco-source-analysis Goto Github PK
View Code? Open in Web Editor NEW中文的Fresco源码解读
中文的Fresco源码解读
请问如何在不清除缓存的情况下,强制直接从网络加载图片呢
可以重新设置下图片链接吗
你好,当我用Fresco的时候采用setController去设置图片,而BaseControllerListener中的onIntermediateImageSet()方法是图片请求成功,控件上面已经显示了图片,现在我想把控件的内容拿到自己对图片内容做处理该如何做呢,采用draweeController.getHierarchy() .getTopLevelDrawable();可以吗?谢谢!
感谢写出那么优秀的分析,我一直有关注fresco,目前据我所知,除了良好的结构,其在效率上的优势也是巨大的,核心是减少gc,4.x上gc卡顿是很明显的。原理是利用ashmem机制,将bitmap不放在虚拟机堆内存,而且有共享native内存,lockpixels是可以将内存锁定、图片解码,但是共享是如何实现还未透彻,猜想是native通过lockpixels持有后,再配合bitmapfactory.options属性共用内存,不知是否正确,希望前辈能写文详解!
非常感谢你得文章,它对我理解 Fresco 的代码得帮助非常大,但在阅读过程中我发现不少图片都失效了。
最近大体看了看fresco的实现,有很多地方不太清楚,比如对从缓存或者网络加载数据时的cancel机制比较疑惑。
拿界面上来说,比如有一个listview在不停的滚动,已经滚出屏幕外但是还没加载完,fresco能不能把这部分请求取消掉呢?
请教fresco能不能做到上面的功能,有没有cancel机制呢,是怎样的呢?还望指导... : )
I use the code to get a AnimatedDrawable
if (image instanceof CloseableAnimatedImage) {
AnimatedImageResult img = ((CloseableAnimatedImage) image).getImageResult();
AnimatedDrawableFactory animatedDrawableFactory = Fresco.getImagePipelineFactory().getAnimatedDrawableFactory();
if (animatedDrawableFactory != null) {
AnimatedDrawableOptions options = new AnimatedDrawableOptionsBuilder().setForceKeepAllFramesInMemory(true).setAllowPrefetching(true).build();
AnimatedDrawable animatedDrawable = animatedDrawableFactory.create(img, options);
if (animatedDrawable != null) {
return animatedDrawable;
}
}
and I want to get a preview image for this AnimatedDrawable
I try renderFrame()
but did not work
hope reply soon!Thanks!
你好,最近我也在看Fresco的东西,有一个地方一直没想通,想请教一下:Fresco为什么要将未解码的数据放到内存缓存中,而不是全部放到磁盘数据里,EncodedMemoryCache的作用到底是什么呢?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.