从磁盘加载时不显示PNG图像

从磁盘加载时不显示PNG图像

本文介绍了从磁盘加载时不显示PNG图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个新闻应用程序,当第一次加载文章时,该应用程序直接从Web显示图像。之后,包含图像的内容将保存在磁盘上(在applicationData.localFolder中)并从那里加载。


问题是除了PNG图像外,一切都运行得很好。它们存储在磁盘上(可以使用Windows Photo Viewer显示),但不会显示在我的应用程序中而不是JPG和GIF图像。


图像链接如下form:ms-appdata:///local/16/15864/imageX.png


使用DOM资源管理器,我能够检查img标签的src属性是否正确设置,但是在PNG图像的情况下,宽度和高度都等于0。


知道可能出现什么问题? PNG必须与JPG和GIF区别对待吗?





解决方案

I've created a news app which displays images directly from the web when an article is loaded for the first time. After that the content including images is saved on disk (in applicationData.localFolder) and loaded from there.

The problem is that everything works perfectly fine except for PNG images. They are stored on disk (and can be shown using Windows Photo Viewer), but aren't displayed in my app as opposed to JPG and GIF images.

Links to images are in the following form: ms-appdata:///local/16/15864/imageX.png

Using the DOM explorer I was able to check that the src attribute of the img tag is correctly set, but both the width and height are equal to 0 in case of PNG images.

Any idea what could be the problem? Do PNGs have to be treated differently than JPGs and GIFs?

解决方案


这篇关于从磁盘加载时不显示PNG图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 13:48
查看更多