使用处理,如何迭代草图数据目录中的文件/图像?
我想加载一堆图像(或文件,但似乎没有对象/类型)——不是按名称,而是按数据目录中的图像加载到数组或其他内容中。有什么方法可以做到这一点吗?这些文档使它看起来不可能,并且搜索处理论坛也没有找到任何结果。但很难相信这是一个遗漏。
有什么提示吗?谢谢!
I want to load a bunch of images (or files but there doesn't seem to be an object/type for that) -- not by name, but just whichever ones are in the data directory, into an array or something. Is there some method for doing that? The docs make it look impossible and searching the Processing forums doesn't turn anything up. But it's kind of hard to believe that it's an omission.
Any hints? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Processing 的优点之一是,如果该语言缺少某些内容,您可以使用 Java 来代替。这是一个老问题,所以也许您已经弄清楚了,但实际上有一个 的示例使用 Java 列出文件 在处理网站上执行此操作。另外,这是一个示例 修改自旧的处理论坛上的一个。它会进行一些可能有用的文件扩展名检查:
One of the neat things about Processing is that if the language is missing something, you can just use Java instead. This is an old question, so maybe you've already figured this out, but there actually is an example of using Java to list files doing this on the Processing website. Also, here's an example modified from one on the old Processing forums. It does some file extension checks that might be helpful: