//ͼƭ���������� var flag = false; function drawimage(imgd, iwidth, iheight) { //����(ͼƭ,����ŀ��,����ĸ߶�) var image = new image(); image.src = imgd.src; if (image.width > 0 && image.height > 0) { flag = true; if (image.width / image.height >= iwidth / iheight) { if (image.width > iwidth) { imgd.width = iwidth; imgd.height = (image.height * iwidth) / image.width; } else { imgd.width = image.width; imgd.height = image.height; } imgd.alt = image.width + "��" + image.height; } else { if (image.height > iheight) { imgd.height = iheight; imgd.width = (image.width * iheight) / image.height; } else { imgd.width = image.width; imgd.height = image.height; } imgd.alt = image.width + "��" + image.height; } } }