简体   繁体   English

html img标签中的图像在我的iPhone应用程序中变得模糊

[英]images in html img tag become blurred on my iPhone application

My iOS Application contains some .html files, .jpg files in project itself. 我的iOS应用程序在项目本身中包含一些.html文件,.jpg文件。 And show them via webView. 并通过webView显示它们。 My image files are high-resolution but when it added to html files with tag and check them with iOS simulator zoom in... images became blurred so that I can't read text on them. 我的图像文件是高分辨率的,但是当它添加到带有标记的html文件中并通过iOS模拟器进行检查时放大。...图像变得模糊,因此我无法读取它们上的文本。

<!DOCTYPE html> 
<html> 
<head>
<title></title>
<meta name="viewport" charset="utf-8" content="initial-scale=1.0; maximum-scale=20.0; user-scalable=yes">
<link rel="stylesheet"  href="style.css" />
<link rel="stylesheet" type="text/css" href="m.ritz.css"/>
<link rel="stylesheet" href="jquery.mobile-1.2.0.min.css" />
<script src="jquery-1.8.2.min.js"></script>
<script src="jquery.mobile-1.2.0.min.js"></script>
<script src="scrollview.js"></script>
</head> 

<body>          
 <img src="tong.png" width="500"/>
</body>                         
</html>      

My code has nothing special... But I can't find the reason... help me~ 我的代码没有什么特别的...但是我找不到原因...帮帮我〜

You appear to be setting a specific width (resolution) for the image within the HTML. 您似乎正在为HTML中的图像设置特定的宽度(分辨率)。 If the stored image has a greater resolution than that requested, the browser will down-sample the image to the requested resolution. 如果存储的图像具有比请求的分辨率更高的分辨率,则浏览器将图像降采样到请求的分辨率。 This process can introduce image artefacts, blurring etc. 此过程可能会引入图像伪影,模糊等。

Try creating an image file which is equal in resolution to that which you wish to display. 尝试创建一个分辨率与要显示的分辨率相等的图像文件。 This should remove the need for the browser to reps ample the image leaving you with a nice sharp image. 这应该消除了浏览器重复显示足够图像的需要,从而为您提供了清晰的图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM