图片一点一点加载。从不清晰的像素点加载到完整图片,或者从上往下加载…
然后我想要用在 cell 中…
我网络断了,我显示半个未加载完的图片在那。
然后我想要用在 cell 中…
我网络断了,我显示半个未加载完的图片在那。
|
1
这是 JPEG 格式的特性,用 PS 导出的时候,勾上‘连续’即可
http://image.zhangxinxu.com/image/blog/201301/2013-01-07_181001.png 详情搜一下渐进式 JPEG |
|
lightforceOct 19, 2015
2
progressive feature
|
|
loveuqianOct 19, 2015 via iPhone
3
@qq286735628 学习了
|
|
ibremnOct 19, 2015
4
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 } } |
|
sneezryOct 19, 2015 via iPhone
5
png 也是支持的, ps 里勾选“交错”
|
|
yetAnotherJoeOct 19, 2015
6
[Concorde]( https://github.com/contentful-labs/Concorde.git) Download and decode progressive JPEGs on iOS.
|