我需要来自asp.net网页的输出图像大小相同 [英] I need same size of output images from asp.net webpage

查看:64
本文介绍了我需要来自asp.net网页的输出图像大小相同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Dear Sir,

Example :

<table>
<tr>
   <td height="50px" width="50px">
      <img src="Nature.jpg"/>
   </td>
   <td>
      <p>Name :Mohan</p>
      <p>Address</p>
      <p>Contact</p>
   </td>
</tr>
<tr>
   <td height="50px" width="50px">
     <img src="Image.jpg"/>
   </td>
   <td>
      <p>Name :Kumar</p>
      <p>Address</p>
      <p>Contact</p>
   </td>
</tr>
</table>


注意我的图片大小是,
nature.jpg(高度:500像素,宽度:400像素)和
Image.jpg(高度:700像素,宽度:500像素)

如何将这些图像设置为基于我的表的td宽度和高度

我的意思是需要在页面中放入相同大小的


回复我.


Note My Image Size is,
nature.jpg(height:500px,Width:400px) and
Image.jpg(height:700px,width:500px)

How to set these images to based my table td width and height

I mean need for same size of out put in my page


reply me.

推荐答案

好的,这可以说得通.您可以执行以下操作:

首先,图像可以具有不同的宽高比.因此,首先,确定您想要相同的宽度还是相同的高度.即使长宽比相同,也要始终仅指定宽度或高度,不要同时指定两者-以防万一.或者,一幅图像的宽度应与另一幅图像的高度或大小之间的任何其他关系相匹配.它应该由您的布局和设计来定义.

在image标签中指定它(不是表格元素或类似的东西):
OK, it can make some sense. Here is what you can do:

First of all, images can have different aspect ratio. So, first of all, decide if you want same width or same height. Even if the aspect ratio is the same, always specify only width or only height, never both — just in case. Or, the width of one image should match the height of another one, or any other relationships between sized. It should be defined by your layout and design.

Specify it in the image tag (not table elements or something like that):
<img src="myFile.png" width="400" alt="My image" />

<img src="myFile.png" width="500" alt="My image" />


尝试使其原始图像大小仅与渲染的大小相同或稍大一些,因此只能将其缩小(重新采样),而不能放大.您的图像将被浏览器自动重新采样.好吧,较小的扩展可能会令人满意,但是即使您使用最好的离线算法,任何较大的扩展也看起来很难看.

在所有情况下,最好只在浏览器中保留少量的重新采样.理想的情况是与源图像精确匹配大小.如果缩小得太多,则会浪费大量带宽.如果您将规模扩大一点,甚至更糟-请参见上文.如果需要更改渲染图像的大小,请尝试用其他大小的图像替换源图像.

—SA


Try to make it so the original image size is only the same as the rendered size or a bit bigger, so it can only scaled (re-sampled) down, not up. Your image will be re-sampled automatically by the browser. Well, minor enlargement can be satisfactory, but any considerable enlargement can look really ugly, even if you use the finest off-line algorithm.

In all cases, it''s the best to keep only minor level of re-sampling in browser. The ideal situation is the exact size match with the source image. If you scale down too much, you waste considerable amount of bandwidth. If you scale up just a bit to much, it''s even worse — please see above. If you need to change rendered image sizes, try to replace the source images with the images of different size.

—SA


修复img标签的高度和宽度
Fix the height and width of the img tag
<img src="smiley.gif" alt="Smiley face" height="500" width="500" />


这篇关于我需要来自asp.net网页的输出图像大小相同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆