如何调整图像大小? [英] How to resize image?

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

问题描述

我已经编写了上传图像并显示图像的代码。但是当显示图像时,它需要太多空间。它看起来太大了。有什么方法可以限制吗?

I have written the code to upload the image and display the image. But when image is displayed it takes too much space. It looks too big. Is any way to restrict this?

推荐答案

这个 [ ^ ]文章解释了如何调整图像大小。
This[^] article explains how to resize image.


调整图像大小的最简单函数是:



Visual Basic .Net

the easiest function to resize the image is :

Visual Basic .Net
Private Function ResizeImage(Image As Image, NewSize As Size) As Image
     Return New Bitmap(Image, NewSize)
End Function







C#.Net




C# .Net

Image ResizeImage(Image img, Size NewSize)
{
    return new Bitmap(img, NewSize );
}


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

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