图片一点一点加载。从不清晰的像素点加载到完整图片,或者从上往下加载…
然后我想要用在 cell 中…
我网络断了,我显示半个未加载完的图片在那。
然后我想要用在 cell 中…
我网络断了,我显示半个未加载完的图片在那。
1
qq286735628 Oct 19, 2015 这是 JPEG 格式的特性,用 PS 导出的时候,勾上‘连续’即可
http://image.zhangxinxu.com/image/blog/201301/2013-01-07_181001.png 详情搜一下渐进式 JPEG |
2
lightforce Oct 19, 2015
progressive feature
|
3
loveuqian Oct 19, 2015 via iPhone
@qq286735628 学习了
|
4
ibremn Oct 19, 2015
progressive/interlaced 是只由模糊变清晰,这个需要图片本身处理过,网上这种图片比较少。
一般图片默认是 baseline 的,即逐行加载。 下面这段代码可以支持 baseline/progressive/interlaced JPEG/PNG/GIF : CGImageSourceRef source = CGImageSourceCreateIncremental(NULL); while (dataArrived) { CGImageSourceUpdateData(source, (__bridge CFDataRef)data, false); if (CGImageSourceGetCount(source) > 0) { CGImageRef imageRef = CGImageSourceCreateImageAtIndex(source, 0, NULL); UIImage *image = [UIImage imageWithCGImage:imageRef scale:screenScale]; /// display } } |
5
sneezry Oct 19, 2015 via iPhone
png 也是支持的, ps 里勾选“交错”
|
6
yetAnotherJoe Oct 19, 2015
[Concorde]( https://github.com/contentful-labs/Concorde.git) Download and decode progressive JPEGs on iOS.
|