Code Monkey home page Code Monkey logo

Comments (8)

ibireme avatar ibireme commented on August 15, 2024

是的,目前 [YYImage imageNamed] 这个方法只支持从 Main Bundle 中查找单个图片,而且也没有缓存。
如果用 assets 来管理图片的话,还是推荐用 UIImage。

from yyimage.

chengxianghe avatar chengxianghe commented on August 15, 2024

那如果用YYImage,项目就不能用Image.xcassets了么,我只是疑问,因为xcassets里还是有很多设置可以操作的

from yyimage.

ibireme avatar ibireme commented on August 15, 2024

是啊。。assets 里有很多苹果自定义的配置,而且也不能支持 WebP 之类的东西。。所以还是推荐用 UIImage。。

以后有时间我会试试看能否做一下兼容。

from yyimage.

shaveKevin avatar shaveKevin commented on August 15, 2024

使用yyimage 支持 svg 和pdf 格式的图片吗?

from yyimage.

ibireme avatar ibireme commented on August 15, 2024

目前不支持。
ImageIO 解码 SVG/PDF 有问题。PDF 倒是可以用其他系统方法解码成图像,但是再编码回 PDF 就不行了。

from yyimage.

shaveKevin avatar shaveKevin commented on August 15, 2024

恩 pdf的系统能够通过[UIImage imagenamed:"xx"] 可以进行加载 用SVG的时候 我使用了 SVGKit中 SVGImage 来加载 发现效果不是那么令人满意。

from yyimage.

ibireme avatar ibireme commented on August 15, 2024

之所以能够用 [UIImage imagenamed:"xx"] 来加载 pdf,是因为打包时 Xcode 把 PDF 转换成了 PNG。。

SVG(和 PDF)都是很复杂的格式,第三方库支持一般都不会太完善,而且这些矢量图的绘制,会随着图像的复杂程度增加而消耗更多的 CPU 资源(想想 Flash 在 PC 上的表现)。这在 PC 上不是什么大问题,但在移动端就难以控制了。

from yyimage.

shaveKevin avatar shaveKevin commented on August 15, 2024

恩恩 好的明白了。

from yyimage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.