如何减少asp.net中的图像大小 [英] how to reduce the image size in asp.net

查看:105
本文介绍了如何减少asp.net中的图像大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在图像控件中显示图像,其中任何尺寸的图像都需要适合图像控件中的特定文件。



例如:



上传照片 [textbok]

加载图片






___________________

| |

| |

| |

| |

|图片|

| |

| |

| |

| |

___________________





当我们点击加载图片时,无论大小如何图像将需要显示在图像控件属性中。

How to display the image in image control where the image consit of any size I need to fit the particular file in the image control.

For example:

Upload a photo[textbok]

Load Image



___________________
| |
| |
| |
| |
| Image |
| |
| |
| |
| |
___________________


When we click on the load image what ever the size of image would be it need to display in the image control property.

推荐答案

使用 PictureBox 控件来显示图片。对于图像的大小,您可以使用PictureBox的 SizeMode [ ^ ] 。



正常:图像位于PictureBox的左上角。如果图像大于包含它的PictureBox,则剪裁图像。



StretchImage: PictureBox中的图像被拉伸或缩小适合PictureBox的大小。



AutoSize: PictureBox的大小等于它包含的图像的大小。 />


CenterImage:如果PictureBox大于图像,则图像显示在中央。如果图像大于PictureBox,则图片放在PictureBox的中心,外边缘被剪裁。



缩放:保持尺寸比例增加或减少图像尺寸。



祝你好运,

OI
Use a PictureBox control for displaying the image. For the size of the image you can PictureBox''s SizeMode[^] property.

Normal: The image is placed in the upper-left corner of the PictureBox. The image is clipped if it is larger than the PictureBox it is contained in.

StretchImage: The image within the PictureBox is stretched or shrunk to fit the size of the PictureBox.

AutoSize: The PictureBox is sized equal to the size of the image that it contains.

CenterImage: The image is displayed in the center if the PictureBox is larger than the image. If the image is larger than the PictureBox, the picture is placed in the center of the PictureBox and the outside edges are clipped.

Zoom: The size of the image is increased or decreased maintaining the size ratio.

Good luck,
OI

这篇关于如何减少asp.net中的图像大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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