如何在 NW.js 中将本地图像显示到控制台?

问题描述

我正在使用 NW.js(node-webkit) 制作桌面应用程序

基于此主题 google chrome console,print image,我正在尝试向控制台显示图像。

正如上述主题所建议的,下面的命令效果很好:

console.log('%c ','font-size:400px; background:url(https://pics.me.me/codeit-google-until-youfinda-stackoverflow-answerwith-code-to-copy-paste-34126823.png) no-repeat;');

问题是,当我尝试使用本地文件 url 完全相同时,例如

console.log('%c ','font-size:400px; background:url(./res/hoge.png) no-repeat;');

console.log('%c ','font-size:400px; background:url(file:///C:/Users/hoge/Pictures/hoge.png) no-repeat;');

控制台什么都不显示

我发现了类似的问题 How to display local image to console? 似乎还没有解决

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)