---
title: "js预览本地图片（根据路径）"
author: "dpn525"
date: "2013-07-12T09:53:25Z"
tags: []
categories: ["Web前端"]
slug: "js"
draft: false
lastmod: "2013-07-12T09:53:25Z"
id: 1904151
url: "https://dpn525.iteye.com/blog/1904151"
---

```
PreviewImg(obj.PhotoPath+cardId+".bmp");
	$("#personcardimage").show();


function PreviewImg(imgFile){  
	//alert(imgFile)
    document.getElementById("personcardimage").style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod = scale)";   
    document.getElementById("personcardimage").filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgFile;
  
   
}

<div id="personcardimage" style="display:none;width:102px;height: 126px;"></div>
```